【问题标题】:angular bootstrap modal show does not get triggered角度引导模态显示不会被触发
【发布时间】:2017-07-30 10:37:20
【问题描述】:

我正在尝试从 Angular Bootstrap (https://ng-bootstrap.github.io/#/components/modal) 实现一个简单的模态

但是,当我单击示例中的按钮(本地实现)时,ngb-modal-window 元素不会转换为不透明度 1。但正如您所见,它确实包含正确的类(淡入淡出):

代码:

<ngb-modal-window role="dialog" style="display: block;" tabindex="-1" ng-reflect-class-name="modal fade show" class="modal fade show">

这会导致同一元素上缺少 css:

.fade.show {
    opacity: 1;
}

当它显示在 plunker/demosites 中时,由于未知原因,我的实现中缺少这部分。

我尝试通过两种方式手动将其添加到我的组件 css 中:

.fade.show {
    opacity: 1;
}

ngb-modal-window.modal.fade.show {
  opacity: 1;
}

两者都不起作用。

可能是什么原因?我错过了一些琐碎的事情吗?

更多信息:

  • &lt;template ngbModalContainer&gt;&lt;/template&gt; 被包括在内
  • NgbModal 被导入到组件中
  • 引导版本 4.0.0-alpha.5

【问题讨论】:

标签: css angular angular-ui-bootstrap bootstrap-modal


【解决方案1】:

https://github.com/ng-bootstrap/ng-bootstrap/issues/1293

这已在 bootstrap 4.0.0-alpha.6 中修复

【讨论】:

    猜你喜欢
    • 2016-11-13
    • 1970-01-01
    • 1970-01-01
    • 2016-07-08
    • 1970-01-01
    • 1970-01-01
    • 2019-12-29
    • 2018-01-31
    相关资源
    最近更新 更多