使用Angular清除所有的bootstrap-ui模式
Clear all bootstrap-ui modals using Angular?
当会话超时时,我们需要清除所有开放的模态。最好的技术是什么?我正试图远离jQuery,让它保持纯粹的Angular。
我们的情态动词按下列方式展开:
//configure the modal
var modalOptions = {
controller: 'modalCtrl',
templateUrl: 'modal.html',
windowClass: 'modal-class',
transclude: true
};
// open the modal
myModal = $modal.open(modalOptions);
我试过模拟背景上的点击和模拟逃离键,没有运气。任何帮助都非常感谢!
实际上这很简单:注入$modalStack
服务并在其上调用dismissAll
方法就足够了:
$modalStack.dismissAll(reason);
例:
$modalStack.dismissAll('session timeout');
相关文章:
- 包括angular 1.3.0项目上的angular bootstrap ui
- Angular+bootstrap ui,检查当前选项卡是否已处于活动状态
- 如何在angular bootstrap ui中聚焦活动导航选项卡中的拳头输入字段
- jQuery UI模式对话框覆盖淡出
- angular ui bootstrap:当模式关闭时,promise被解析/拒绝
- 延迟角度 UI 模式关闭
- 如何使用 angularjs 使用 ngrepeat 和 bootstrap ui 创建分页
- 角度 UI 模式开机自检
- Bootstrap JS模式加载,但不可编辑
- 处理Bootstrap关闭模式
- 在模态(bootstrap ui angular)中编辑现有联系人
- 如何在不创建数组的情况下使用NgFor来生成矩阵UI模式
- AngularJS bootstrap.ui模态未显示
- jquery ui模式框中的表单隐藏后,键盘将不再被调用
- 语义 UI 模式未定义
- 将 UI 模式对话框添加到新的 DIV 标记
- AngularJS bootstrap-ui 选项卡拉入本地 html 内容
- jQuery UI 模式对话框在关闭之前挂起
- 使用Angular清除所有的bootstrap-ui模式
- Angular bootstrap ui模式窗口出现问题