Hi,
I did install ng2-bootstrap with version 1.1.5 and I am getting below error because of bsModal directive is missing in /component/modal/modal.component.ts
Below is the error message which i am getting :
zone.js?1474796609884:344 Unhandled Promise rejection: Template parse errors:
There is no directive with "exportAs" set to "bs-modal" ("<div bsModal [ERROR ->]#lgModal='bs-modal' class='modal fade' tabindex='-1' role='dialog' aria-labelledby='myLargeModalLabel"): ModalComponent@0:13
There is no directive with "exportAs" set to "bs-modal" ("
Can someone please help me on this?
Did you import the ModalModule into your app.module? i.e.:
import { ModalModule } from 'ng2-bootstrap/ng2-bootstrap';
...
@NgModule({
bootstrap: [App],
declarations: [
App,
],
imports: [
....
ModalModule
...
Im having the same issue and I have imported the ModalModule in my app module
Can you put your code up somewhere to review? Or a plunkr?
I have added ModalModule and now Its working!
Turns out I had imported ModalModule in my app module and not in the child module that actually uses the modal, changed that and its working fine :)
I had the same issue. Then I imported the "ModalModule" in app.module.ts as explained above. This solved my problem.
Most helpful comment
Did you import the ModalModule into your app.module? i.e.:
import { ModalModule } from 'ng2-bootstrap/ng2-bootstrap';...
@NgModule({bootstrap: [App],declarations: [App,],imports: [....ModalModule...