Modal not showing on Angular 2.4 and 4.
See original GitHub issueBug description:
Modal is not showing anymore after re-targeting web app to angular 4
and @angular/cli@1.0.0
.
I was just going to look for another lib (since this one technically does not support my bootstrap version), but when I read this https://github.com/ng-bootstrap/ng-bootstrap/issues/1209 I decided to post here. Maybe it’s a bug or something changed. Anyway, this code was working:
let modal: NgbModalRef = this.modalService.open(this.config.createModal);
let modalInstance: BaseModal = modal.componentInstance as BaseModal;
where this.config.createModal
is a component. Even though this lib does not officially support bootstrap 3, it was working fine for quite some time. But now it looks like the modal was opened but it’s not displayed. The body class modal-open
is added:
The scrollbar disappears and the component’s (modal’s component) onInit method is hit. So I’m assuming is something related only to the visual component not being displayed.
Version of Angular, ng-bootstrap, and Bootstrap:
Angular: 4.0.0 (though I tried with 2.4 as well)
ng-bootstrap: 1.0.0-alpha.22
Bootstrap: 3.3.7
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (3 by maintainers)
Top GitHub Comments
You might try alpha.17 as this is the last version before we’ve switched to Bootstrap 4 alpha.6: https://github.com/ng-bootstrap/ng-bootstrap/blob/master/CHANGELOG.md#100-alpha17-2017-01-09