Issue with NgbModelBackdrop
See original GitHub issueERROR { Error: Uncaught (in promise): Error: No component factory found for NgbModalBackdrop. Did you add it to @NgModule.entryComponents?
Error: No component factory found for NgbModalBackdrop. Did you add it to @NgModule.entryComponents?
at noComponentFactoryError (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:8581:34)
at CodegenComponentFactoryResolver.resolveComponentFactory (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:8645:19)
at new NgbModalStack (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:70536:59)
at _createClass (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15418:20)
at _createProviderInstance$1 (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15388:26)
at resolveNgModuleDep (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15373:17)
at _createClass (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15418:107)
at _createProviderInstance$1 (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15388:26)
at resolveNgModuleDep (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15373:17)
at NgModuleRef_.get (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:16598:16)
at resolvePromise (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:136092:31)
at resolvePromise (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:136063:17)
at /home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:136141:17
at ZoneDelegate.invokeTask (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:135693:31)
at Object.onInvokeTask (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:9412:33)
at ZoneDelegate.invokeTask (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:135692:36)
at Zone.runTask (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:135460:47)
at drainMicroTaskQueue (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:135870:35)
at ZoneTask.invokeTask (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:135771:21)
at Server.ZoneTask.invoke (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:135756:48)
rejection:
{ Error: No component factory found for NgbModalBackdrop. Did you add it to @NgModule.entryComponents?
at noComponentFactoryError (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:8581:34)
at CodegenComponentFactoryResolver.resolveComponentFactory (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:8645:19)
at new NgbModalStack (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:70536:59)
at _createClass (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15418:20)
at _createProviderInstance$1 (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15388:26)
at resolveNgModuleDep (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15373:17)
at _createClass (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15418:107)
at _createProviderInstance$1 (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15388:26)
at resolveNgModuleDep (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15373:17)
at NgModuleRef_.get (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:16598:16)
ngComponent: { [Function: NgbModalBackdrop] decorators: [Array], ctorParameters: [Function] },
__zone_symbol__currentTask:
ZoneTask {
_zone: [Object],
runCount: 0,
_zoneDelegates: null,
_state: 'notScheduled',
type: 'microTask',
source: 'Promise.then',
data: undefined,
scheduleFn: undefined,
cancelFn: null,
callback: [Function],
invoke: [Function] } },
promise:
ZoneAwarePromise {
__zone_symbol__state: 0,
__zone_symbol__value: { Error: No component factory found for NgbModalBackdrop. Did you add it to @NgModule.entryComponents?
at noComponentFactoryError (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:8581:34)
at CodegenComponentFactoryResolver.resolveComponentFactory (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:8645:19)
at new NgbModalStack (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:70536:59)
at _createClass (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15418:20)
at _createProviderInstance$1 (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15388:26)
at resolveNgModuleDep (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15373:17)
at _createClass (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15418:107)
at _createProviderInstance$1 (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15388:26)
at resolveNgModuleDep (/home/jinna/JINNA-FOLDER/angular-cli/gluoed-app/gluoed/dist/server.js:15373:17)
Here is my app.module.ts
import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { FormsModule } from '@angular/forms';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { HeaderComponent } from './components/layouts/header/header.component';
import { FooterComponent } from './components/layouts/footer/footer.component';
import { MainComponent } from './components/layouts/main/main.component';
import { LoaderComponent } from './components/layouts/loader/loader.component';
import { NotFoundComponent } from './components/not-found/not-found.component';
import { YoutubeTrendingComponent, NgbdModalContentComponent } from './components/youtube-trending/youtube-trending.component';
import { TopHeadlinesComponent } from './components/top-headlines/top-headlines.component';
import { YoutubeService } from './shared/services/youtube.service';
import { GoogleHotTrendsService } from './shared/services/google-hot-trends.service';
import { TwitterHotTrendsService } from './shared/services/twitter-hot-trends.service';
import { InstagramHotTrendsService } from './shared/services/instagram-hot-trends.service';
import { NewsApiService } from './shared/services/news-api.service';
import { CountryService } from './shared/services/country.service';
import { NumaralsPipe } from './shared/pipes/numarals.pipe';
import { TruncatePipe } from './shared/pipes/truncate.pipe';
import { HttpClientModule } from '@angular/common/http';
import { HttpModule, JsonpModule } from '@angular/http';
import { NgbModalBackdrop } from '@ng-bootstrap/ng-bootstrap/modal/modal-backdrop';
@NgModule({
declarations: [
AppComponent,
HeaderComponent,
FooterComponent,
MainComponent,
LoaderComponent,
NotFoundComponent,
YoutubeTrendingComponent,
TopHeadlinesComponent,
NumaralsPipe,
TruncatePipe,
NgbdModalContentComponent
],
imports: [
BrowserModule.withServerTransition({ appId: 'gluoed-app' }),
AppRoutingModule,
NgbModule.forRoot(),
BrowserModule.withServerTransition({ appId: 'gluoed' }),
AppRoutingModule,
HttpClientModule,
BrowserTransferStateModule,
HttpModule,
JsonpModule,
FormsModule
],
providers: [
NgbModalBackdrop,
YoutubeService,
GoogleHotTrendsService,
TwitterHotTrendsService,
InstagramHotTrendsService,
NewsApiService,
CountryService],
bootstrap: [AppComponent],
entryComponents: [
HeaderComponent,
FooterComponent,
MainComponent,
LoaderComponent,
NotFoundComponent,
YoutubeTrendingComponent,
TopHeadlinesComponent,
NgbdModalContentComponent,
NgbModalBackdrop
],
})
export class AppModule { }
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Backdrop z-Index forced to 1050 · Issue #2686 - GitHub
I have an issue with v13 too. The z-index is set to 1055 and the overlay is over all the page: image. HTML...
Read more >angular/ngbmodal: backdropClass doesnt work - Stack Overflow
Backdrops of ng-bootstrap modals are injected into body tag. Don't change app ViewEncapsulation, ... It's gonna cause you a lot of problems.
Read more >Modal - Angular powered Bootstrap
Dismisses the modal with an optional reason value. The NgbModalRef.result promise will be rejected with the provided value. NgbModal. Service.
Read more >Modal backdrop: static not allowing clicks without closing t
Let me explain my problem again: I want the modal to act as a popup which does not close automatically either interrupts the...
Read more >Bootstrap Modal Dialog showing under Modal Background
On more than a few occasions I've run into issues with Bootstrap's Modal dialog rendering incorrectly with the dialog showing underneath the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Add NgbModule.forRoot() in your imports, it solves the problem
guys, Injector saved my life. Inside your component change this: to this: So NgbModal will be instantiated only for browser version and you wouldn’t see error about NgbModalBackdrop
P.S. Angular 5.1.1