Skip to content

Commit

Permalink
feat: modal support set nzOkDisabled and nzCancelDisabled(#1838)
Browse files Browse the repository at this point in the history
  • Loading branch information
kekehaoz committed Jan 29, 2019
1 parent 09f21d0 commit b17add6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/modal/nz-modal.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
>{{ button.label }}</button>
</ng-container>
<ng-container *ngSwitchDefault>
<button *ngIf="nzCancelText!==null" nz-button (click)="onClickOkCancel('cancel')" [nzLoading]="nzCancelLoading">
<button *ngIf="nzCancelText!==null" nz-button (click)="onClickOkCancel('cancel')" [nzLoading]="nzCancelLoading" [disabled]="nzCancelDisabled">
{{ cancelText }}
</button>
<button *ngIf="nzOkText!==null" nz-button [nzType]="nzOkType" (click)="onClickOkCancel('ok')" [nzLoading]="nzOkLoading">
<button *ngIf="nzOkText!==null" nz-button [nzType]="nzOkType" (click)="onClickOkCancel('ok')" [nzLoading]="nzOkLoading" [disabled]="nzOkDisabled">
{{ okText }}
</button>
</ng-container>
Expand Down
3 changes: 2 additions & 1 deletion components/modal/nz-modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ export class NzModalComponent<T = any, R = any> extends NzModalRef<T, R> impleme
get cancelText(): string {
return this.nzCancelText || this.locale.cancelText;
}

@Input() nzOkDisabled: boolean = false;
@Input() nzCancelDisabled: boolean = false;
@Input() @InputBoolean() nzCancelLoading: boolean = false;
@Input() @Output() readonly nzOnCancel: EventEmitter<T> | OnClickCallback<T> = new EventEmitter<T>();
@ViewChild('modalContainer') modalContainer: ElementRef;
Expand Down

0 comments on commit b17add6

Please sign in to comment.