Modal confirms that the callback will not disappear automatically.

< nz-modal [(nzVisible)] = "isShow" [nzTitle] = "title" [nzContent] = "modalContent" [nzFooter] = "modalFooter" (nzOnCancel) = "handleCancel ()" >
< ng-template-sharpmodalContent >

<div  class="content">
</div>

< / ng-template >
< ng-template-sharpmodalFooter >

<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;
/ / cancel
public handleCancel () {

this.isShow = false;

}
/ / confirm
public handleOk () {

this.isLoading = true;
this.param["name"] = this.inputValue
this.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;
});

}


angularjs cannot listen to promise for data requests other than the functions encapsulated by itself. Either force the update manually, or modify the request function, such as "$http.get (.)"

reference https://codeshelper.com/q/10.


if it is Chrome, click F12 to see if there are any errors in development mode

Menu