current value of progress bar. Could be a number or array of objects like {"value":15,"type":"info","label":"15 %"}
\n"
}
],
"outputs": [],
diff --git a/src/progressbar/bar.component.ts b/src/progressbar/bar.component.ts
index 18d7b7265b..ffb3854b34 100644
--- a/src/progressbar/bar.component.ts
+++ b/src/progressbar/bar.component.ts
@@ -1,6 +1,7 @@
-import { Component, Host, Input, OnDestroy, OnInit } from '@angular/core';
+import { Component, Host, HostBinding, Input, OnDestroy, OnInit } from '@angular/core';
import { ProgressDirective } from './progress.directive';
+import { isBs3 } from '../utils/ng2-bootstrap-config';
// todo: number pipe
// todo: use query from progress?
@@ -10,8 +11,8 @@ import { ProgressDirective } from './progress.directive';
-
+
+
+
+ {{item.label}}
+
- `
+ `,
+ styles: [`
+ :host {
+ width: 100%;
+ }
+ `]
})
export class ProgressbarComponent {
/** if `true` changing value of progress bar will be animated (note: not supported by Bootstrap 4) */
@@ -18,8 +27,16 @@ export class ProgressbarComponent {
@Input() public max:number;
/** provide one of the four supported contextual classes: `success`, `info`, `warning`, `danger` */
@Input() public type:string;
- /** current value of progress bar */
- @Input() public value:number;
+ /** current value of progress bar. Could be a number or array of objects like {"value":15,"type":"info","label":"15 %"} */
+ @Input() public set value(value: number | any[]) {
+ this.isStacked = Array.isArray(value);
+ this._value = value;
+ };
+ public isStacked: boolean = false;
+ public _value: number | any[];
+ public get isBs3(): boolean {
+ return isBs3();
+ }
public constructor(config: ProgressbarConfig) {
Object.assign(this, config);