Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Question about Using MDB in sub modules in Angular

novvia free asked 5 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 5 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

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.1
  • Device: Macbook Pro
  • Browser: Chrome
  • OS: OS X
  • Provided sample code: Yes
  • Provided link: Yes