angular - 当以角度 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">×</span>
</button>
</div>
</ng-template>
当在角度 5 中按下浏览器后退按钮时,我的模式弹出窗口没有关闭当按下后退按钮时我如何关闭此弹出窗口..???
解决方案
这是答案..
openPopup() {
if (this.showFileUpload) {
this.mdl= this.modalService.open(this.uploadFileModal);
setTimeout(() => {
this.mdl.close();
}, 9000);
}
}
推荐阅读
- javascript - Javascript对象保留“旧”属性,不能覆盖?
- swift - 如何更改 SpriteKit 中精灵的触摸偏移量?
- python - 在 pytorch 中使用量化模型没有性能提升
- azure - Azure 的 myapps 门户中面向 B2B 用户的聊天机器人
- snowflake-cloud-data-platform - 雪花:为什么在资源争用期间查询会重试两次
- r - 编写我的第一个闪亮的应用程序,如何通过选定的变量进行绘图,为什么这个脚本不起作用?
- python - 如何通过 Pygame 从 MIDI 设备获取输入?
- c++ - 将数据放在私有类中是否理想?(C++)
- javascript - 成功登录后, this.props.history.push 不会进入新页面,因为 ProtectedRoute 不成功
- javascript - 如果数组超出索引,有人可以解释以下函数会发生什么吗?