Topic: Can't user Component in Lasy Load Module or subModule
Dawid Adach pro answered 7 years ago
nsteve pro commented 7 years ago
Dear Dawid This is my NgModule @NgModule({ imports: [BrowserModule, HttpModule, BrowserAnimationsModule, FormsModule, routing2, UtilsModule, CoreBaseModule, SmartadminLayoutModule, ToastModule.forRoot(), MDBBootstrapModule.forRoot(), MDBBootstrapModulePro.forRoot(), TranslateModule.forRoot({ loader: { provide: TranslateLoader, useFactory: HttpLoaderFactory, deps: [Http] } }) ] , exports: [ // SpinnerComponentModule,// SpinnerComponent ] , declarations: [App2Component, routed2Components,// PostesComponent, //ObservableComponent,//SpinnerComponent, ],//SharedSubComponent, MenuComponent // exports: [SharedSubComponent], providers: [APP_PROVIDERS, MDBSpinningPreloader, AuthService, AuthGuard, Title, { provide: APP_BASE_HREF, useValue: '/' }, I18nService], //MathService bootstrap: [App2Component], schemas: [NO_ERRORS_SCHEMA], entryComponents: [App2Component] }) But I want to call it inside a component register in another child module(with Lazy loading)Dawid Adach pro commented 7 years ago
If you want to use Lazy loading you have to import MDB into all child modules where you want to use it, by default in Angular imports are not inherited.FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No