npm - Read and List all exports of an angular module -
the initial situation follows: in node_moduls
folder of project there module called @example
components want use in application. amount of components varies therefore it´s necessary state dynamically components included inside module. example.module.ts
file looks this:
import { ngmodule } '@angular/core'; import { ngbmodule } '@ng-bootstrap/ng-bootstrap'; import { firstmodule } 'example_path'; import { secondmodule } 'example_path'; import { thirdmodule } 'example_path'; import { fourthmodule } 'example_path'; const modules = [ firstmodule, secondmodule, thirdmodule, fourthmodule ]; @ngmodule({ imports: [ngbmodule.forroot(), ...modules], exports: [ngbmodule, ...modules], providers: [exampleservice] }) export class examplemodule { }
the modules
array contains components included. module gets imported app following app.module.ts
import { browsermodule } '@angular/platform-browser'; import { ngmodule } '@angular/core'; import { examplemodule } '@example/example-module'; import { appcomponent } './app.component'; @ngmodule({ declarations: [ appcomponent ], imports: [ browsermodule, examplemodule ], providers: [], bootstrap: [appcomponent] }) export class appmodule { }
is possible somehow determine inside app components examplemodule
exports or rather app imports module?
@ end in example app should know firstmodule
, secondmodule
, thirdmodule
, fourthmodule
imported , used.
Comments
Post a Comment