0

Just like addImportToModule or addProviderToModul,my module file look like this:

const EXAMPLES = [
    ButtonIconExampleComponent,
    ButtonTextExampleComponent,
    ButtonDashedExampleComponent
]

@NgModule({
    declarations: EXAMPLES,
    imports: [CommonModule],
    entryComponents: EXAMPLES,
    exports: EXAMPLES,
    providers: []
})
export class ExamplesModule {}

variable EXAMPLES can be used many times,so I want to change it with schematics utils function.

injoker1
  • 163
  • 10

1 Answers1

0

You can make it a global variable by exporting it using export then you can use it everywhere in .ts files.

Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54