Question about Using MDB in sub modules in Angular


Topic: Question about Using MDB in sub modules in Angular

novvia asked 6 years ago

I am trying to set up my app to use the same sort of modules and routing as in the example here:

https://angular.io/guide/router#the-sample-application

It works fine, but when I try to use a MDB element in my submodule, I get an error similiar to this:

If 'mdb-side-nav' is an Angular component and it has 'sidenavBreakpoint' input, then verify that it is part of this module.

It works fine if I put MDBBootstrapModulesPro.forRoot() in each sub module, but is there a way to put it in the app.module.ts so it is available in all sub modules.


Damian Gemza staff answered 6 years ago

Dear @novvia

You should create something like SharedModule, and import there MDBBootstrapModulesPro.forRoot().

And now, you should import SharedModule in every feature module, where you want to use MDB components.

You can read more about shared modules here.

Best Regards,

Damian


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: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.1
  • Device: Macbook Pro
  • Browser: Chrome
  • OS: OS X
  • Provided sample code: No
  • Provided link: Yes