Topic: Can't user Component in Lasy Load Module or subModule

nsteve pro asked 4 years ago


Hello, I am trying to call Mdb <mdb-sidenav #sidenav class="sn-bg-1 fixed" [fixed]="true"> in sub module or lazy load module for Angular. Below the error message compiler.es5.js:1694 Uncaught Error: Template parse errors: Can't bind to 'fixed' since it isn't a known property of 'mdb-sidenav'. 1. If 'mdb-sidenav' is an Angular component and it has 'fixed' input, then verify that it is part of this module. this is How Import in my app.mndule   import { ToastModule } from './typescripts/pro/alerts/toast/toast.module'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { MDBBootstrapModule } from './typescripts/free'; import { MDBBootstrapModulePro } from './typescripts/pro/index'; import { MDBSpinningPreloader } from './typescripts/pro/index'   Need help !  

Dawid Adach pro answered 4 years ago


Dear nsteve, did you follow our installation guide: https://mdbootstrap.com/angular/5min-quickstart/ ? Please make sure to use NO_ERROR_SCHEMA   Dawid

nsteve pro commented 4 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 4 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.


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags