2

I would like to print all module declared components. Is it possible ?

Assuming I have the following module, I would like to be able to print from anywhere the HelloWorldComponent and WorldHellopComponent names.

@NgModule({
    declarations   : [
       HelloWorldComponent,
       WorldHelloComponent
 ]})
 export class HelloModule {}
john Smith
  • 1,565
  • 7
  • 34
  • 54
  • you can access them all on the `applicationRef.componentTypes`, it seems that you can't do that on the module, because `moduleRef` doesn't expose it. If you use a class of module, you can probably use `ReflectMetadata` to get the list from the decorator – Max Koretskyi Jul 04 '17 at 19:32
  • Possible duplicate of [Access Meta-Annotation inside Class (TypeScript)](https://stackoverflow.com/questions/34465214/access-meta-annotation-inside-class-typescript) – Edmundo Santos Jul 04 '17 at 19:45

0 Answers0