Topic: Mdb in one share module
Good day, Is there any option to use MDBBootstrapModulesPro in a separate, shared module? I would like to have one module for shared components (now alternate MDB, but it could be more) and only import in submodules without having to add MDBBootstrapModulesPro.forRoot(). Instead, I would just import this shared module.
I now have such modulus and seem to be functional but I don't know whether it's right and I can't get some problems :
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MDBBootstrapModulesPro } from 'ng-uikit-pro-standard';
@NgModule({
declarations: [],
imports: [
CommonModule,
MDBBootstrapModulesPro.forRoot(),
],
exports: [
MDBBootstrapModulesPro,
]
})
export class ExternalComponentsModule { }
Without the export, it does not work, but I do not know whether the forRoot module is correct at the same time.
Over time, forRoot exchange for individual modules and components we use to be the resulting JavaScript smaller, but maybe sometimes in the future. However, thanks to this, it could be solved in one place.
Arkadiusz Idzikowski staff answered 3 years ago
@pbalcz MDBBootstrapModulesPro.forRoot()
import contains all the free and pro components modules available in the MDB Angular library. If you need to create a shared module it would be better to use smaller modules imports for specific components. You can find a list of all MDB Angular components in our documentation:
https://mdbootstrap.com/docs/angular/getting-started/modules/
pbalcz commented 3 years ago
Good day, For the future, I will count on the use of specific modules that we use, MDBbootstrapmodulesPro.forRoot () is an existing state. It's one of the reasons why I want to have everything in one shared module to change it later in one place. It was mainly about whether the shared module is written (see sample code) is technically fine whether I can also export this forroot module and does not cause any performance or other problems.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: MDB4 10.0.0
- Device: PC
- Browser: Mozilla Firefox
- OS: Windows 10
- Provided sample code: No
- Provided link: No