Modal not showing on Angular 2.4 and 4.

Bug 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 #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:

screen shot 2017-03-30 at 08 48 31

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

2 thoughts on “Modal not showing on Angular 2.4 and 4.