简体   繁体   中英

Can I create custom templates for sources generated by Angular CLI

When I execute the following command in an Angular 9 project to generate eg a component

$ ng generate component

I would like to customize the sources generated - in particular the unit and e2e test files.

Is there a mechanism for me to provide templates, or modify existing ones?

they should also be accessible to all team members on my project.

I am aware of yo generators , but I'd prefer to stick with ng .

They are called Schemactics and there is an official documentation for it. You can find it here: https://angular.io/guide/schematics

You can also find a lot of good guides around the Internet regarding this topic, i guess you were just missing the correct name to find the information :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM