相关疑难解决方法(0)

Angular Bootstrap Modal让背景打开

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

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

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

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

modalInstance.close();
Run Code Online (Sandbox Code Playgroud)

模态本身消失了,背景也逐渐消失,但它没有从DOM中删除,因此它覆盖了整个页面,使页面无响应.

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

在此输入图像描述

https://angular-ui.github.io/bootstrap/#/modal上的文档中的示例中,modal-open将从正文中删除该类,并modal-backdrop在关闭时从DOM中删除整个类.为什么模态逐渐消失,但在我的示例中没有从DOM中删除背景?

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

angularjs angular-ui angular-ui-bootstrap bootstrap-modal

24
推荐指数
2
解决办法
2万
查看次数