我正在开发一个angular2项目,我们使用“bootstrap”包:“~3.3.7”。
我们在尝试打开模态时遇到问题。当我们检查HTML时,它显示以下内容
<ngb-modal-backdrop class="modal-backdrop fade show"></ngb-modal-backdrop>
<ngb-modal-window role="dialog" style="display: block;" tabindex="-1" ng-reflect-class-name="modal fade show" class="modal fade show">
请注意,在class属性中,背景和窗口都有一个类“Show”。但是,如果我们在开发人员控制台上手动更改此设置并将“show”切换为“in”,则模式将显示在屏幕上。
调用模态时,我们没有做任何奇怪的事情:
this.modalDialog = this.modalService.open(SiteSettingsEditDialog);
知道会发生什么吗?
ng-bootstrap仅适用于Bootstrap 4 CSS,因此您必须将Bootstrap软件包更新到4.0.0-alpha.6。
ng-bootstrap项目决定支持Bootstrap 4,因为Bootstrap团队不再维护Bootstrap 3,所有开发仅在版本4上进行。