diff --git a/src/components/progress/nz-progress.component.ts b/src/components/progress/nz-progress.component.ts index ab1d6dadc1..052205b9ff 100644 --- a/src/components/progress/nz-progress.component.ts +++ b/src/components/progress/nz-progress.component.ts @@ -87,7 +87,7 @@ export class NzProgressComponent implements ControlValueAccessor, OnInit { } writeValue(value: number): void { - this._percent = value; + this._percent = value == null ? 0 : +value; if (this._percent === 100) { this.nzStatus = 'success'; } else { diff --git a/src/showcase/nz-demo-progress/nz-demo-progress-basic.component.ts b/src/showcase/nz-demo-progress/nz-demo-progress-basic.component.ts index bff6989961..9900a7b38d 100644 --- a/src/showcase/nz-demo-progress/nz-demo-progress-basic.component.ts +++ b/src/showcase/nz-demo-progress/nz-demo-progress-basic.component.ts @@ -3,6 +3,7 @@ import { Component } from '@angular/core'; @Component({ selector: 'nz-demo-progress-basic', template: ` + @@ -11,4 +12,6 @@ import { Component } from '@angular/core'; `, styles : [] }) -export class NzDemoProgressBasicComponent { } +export class NzDemoProgressBasicComponent { + value: number; +}