<nz-modal [(nzVisible)]="isShow" [nzTitle]="title" [nzContent]="modalContent" [nzFooter]="modalFooter" (nzOnCancel)="handleCancel()"><ng-template #modalContent><div class="content"></div></ng-template><ng-template #modalFooter><button nz-button [nzType]="'primary'" (click)="handleOk()" [nzLoading]="isLoading">確定</button>
<button nz-button [nzType]="'default'" (click)="handleCancel()">取消</button></ng-template></nz-modal>ts里得內容:public isShow = false;public isLoading = false;// 取消public handleCancel() {this.isShow = false;}// 確定public handleOk() {this.isLoading = true;this.param['name'] = this.inputValuethis.roleManagementService.addModifyDepartment(this.param).subscribe((res: any) => { if (res.status === 0) {
console.log(res.data)
} else {
console.log(res.data)
} this.isLoading = false; this.isShow = false;
});}
Modal確認回調后不自動消失
隔江千里
2018-11-13 21:20:56