Ngx-bootstrap: bsModal is missing

Created on 25 Sep 2016  路  6Comments  路  Source: valor-software/ngx-bootstrap

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?

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
...

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghiscoding picture ghiscoding  路  3Comments

haisaco picture haisaco  路  3Comments

PascalHonegger picture PascalHonegger  路  3Comments

RolfVeinoeSorensen picture RolfVeinoeSorensen  路  3Comments

srjkrl20011991 picture srjkrl20011991  路  3Comments