Skip to content

Commit

Permalink
fix(module:progress): fix 100% when specify invalid value (NG-ZORRO#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored and vthinkxie committed Jan 15, 2018
1 parent d480687 commit a021140
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/progress/nz-progress.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'nz-demo-progress-basic',
template: `
<nz-progress [ngModel]="value"></nz-progress>
<nz-progress [ngModel]="30"></nz-progress>
<nz-progress [ngModel]="50" [nzStatus]="'active'"></nz-progress>
<nz-progress [ngModel]="70" [nzStatus]="'exception'"></nz-progress>
Expand All @@ -11,4 +12,6 @@ import { Component } from '@angular/core';
`,
styles : []
})
export class NzDemoProgressBasicComponent { }
export class NzDemoProgressBasicComponent {
value: number;
}

0 comments on commit a021140

Please sign in to comment.