No provider for NgbModalStack

Wayn Chaw picture Wayn Chaw · Oct 10, 2016 · Viewed 15k times · Source

For some reason, I am suddenly getting this error out of the blue, with no code changes. Any ideas what would be causing this?

I was able to solve this with adding NgbModule.forRoot() to my imports, but now I get this error:

Property 'forRoot' does not exist on type 'typeof NgbModule'.

the application is running fine otherwise.

Answer

Hung Vi picture Hung Vi · Oct 21, 2016

I've got the same problem with you. I tried to add .forRoot() to NgbModule. Try to configure your @NgModule decorator like this:

   imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot(appRoutes),
    NgbModule.forRoot()
  ]

Hope this help.