我有 2 个 ng-Template,第一个模态正在打开另一个模态。当我隐藏顶部模式时,它也隐藏了下面的模式,只留下黑色背景并且应用程序无法使用,我必须手动刷新浏览器。在我们升级到 Angular 7 到 10 之前,这一切正常。
从 'ngx-bootstrap/modal' 导入 { BsModalService , BsModalRef} ;
closeTestPopup1()
{
this.modalRef.hide();
}
openpopup2(template)
{
this.modalRef2 = this.modalService.show(template, { class: 'mrk-def-modal approve-task-modal modal-dialog-centered' });
}
closeTestPopup2()
{
this.modalRef2.hide();
}
<ng-template #TestPopup1>
<div class="btn-row mt-3 d-none d-md-flex">
<button i18n matRipple class="btn btn-secondary btn-sm ml-auto" type="button" (click)="closeTestPopup1()">
Cancel
</button>
<button i18n matRipple class="btn btn-primary btn-sm ml-2 set-s-bg-color" (click)="openpopup2(TestPopup2)"
>
Save
</button>
</div>
</ng-template>
<ng-template #TestPopup2>
<div class="btn-row mt-3 d-none d-md-flex">
<button i18n matRipple class="btn btn-secondary btn-sm ml-auto" type="button" (click)="closeTestPopup2()">
Cancel popup 2
</button>
<button i18n matRipple class="btn btn-primary btn-sm ml-2 set-s-bg-color" type="submit"
>
Save
</button>
</div>
</ng-template>