首页 > 解决方案 > 当以角度 5 按下浏览器后退按钮时,我的模式弹出窗口没有关闭

问题描述

<ng-template #upload let-c="close" let-d="dismiss"   >
    <div class="modal-header">
        <h5 class="modal-title" >Upload File</h5>
            <button type="button" class="close" aria-label="Close" (click)="d('Cross 
          click')">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
</ng-template>

当在角度 5 中按下浏览器后退按钮时,我的模式弹出窗口没有关闭当按下后退按钮时我如何关闭此弹出窗口..???

标签: angular

解决方案


这是答案..

openPopup() {
    if (this.showFileUpload) {
        this.mdl= this.modalService.open(this.uploadFileModal);
        setTimeout(() => {
            this.mdl.close();
        }, 9000);
    }
}


推荐阅读