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.

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

1 Comment

Well,but my only need is just push a variable to const EXAMPLES when run schematic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.