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: Mdb in one share module

pbalcz free asked 2 years ago


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 2 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 free commented 2 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.



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: MDB4 10.0.0
  • Device: PC
  • Browser: Mozilla Firefox
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No