Angular Bootstrap Modal 将背景打开 [英] Angular Bootstrap Modal leaves backdrop open

查看:27
本文介绍了Angular Bootstrap Modal 将背景打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 AngularUI 将 Bootstrap 组件集成到我的 Angular 1.4 应用程序中,例如 Modals.

I'm using AngularUI to integrate Bootstrap components in my Angular 1.4 app, such as Modals.

我在我的控制器中调用一个 Modal,如下所示:

I'm calling a Modal in my controller like so:

var modalInstance = $modal.open({
  animation: true,
  templateUrl: '/static/templates/support-report-modal.html',
  controller: 'ModalInstanceCtrl'
});

不幸的是,当我想使用以下方法关闭 Modal 时:

Unfortunately, when I want to close the Modal by using:

modalInstance.close();

模态本身消失,背景也淡出,但它没有从 DOM 中删除,所以它覆盖了整个页面,使页面无响应.

The modal itself dissapears, and the backdrop also fades out, but it isn't removed from the DOM, so it overlays the whole page leaving the page unresponsive.

当我检查时,我看到了这个:

When I inspect, I'm seeing this:

https://angular-ui.github.io 文档中的示例中/bootstrap/#/modalmodal-open 从主体中移除,整个 modal-backdrop 在关闭时从 DOM 中移除.为什么在我的示例中,Modal 淡出,但背景没有从 DOM 中删除?

In the example in the Documentation on https://angular-ui.github.io/bootstrap/#/modal The class modal-open is removed from body and the whole modal-backdropis removed from the DOM on close. Why is the Modal fading out but the backdrop not removed from the DOM in my example?

我已经查看了许多关于 bootstrap Modals 背景的其他问题,但我似乎无法弄清楚出了什么问题.

I've checked out many of the other questions about the backdrop of bootstrap Modals but I can't seem to figure out what's going wrong.

推荐答案

这显然是由于一个错误.AngularUI 还不支持 Angular 1.4.一次 http://github.com/angular-ui/bootstrap/issues/3620 已解决,这将起作用.

This is apparently due to a bug. AngularUI doesn't support Angular 1.4 yet. Once http://github.com/angular-ui/bootstrap/issues/3620 is resolved this will work.

这篇关于Angular Bootstrap Modal 将背景打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆