Example how to build a custom schematics package for Angular CLI.
Angular Devkit | Angular CLI |
---|
npm run iboth
in root directorycd ./foo/src/app
ng g c {name} -c=@schematics/custom
OR
ng generate component {name} --collection=@schematics/custom
- Open
./schematics/component/files/___path__/__name@dasherize@if-flat__
- Create new file with name
__name@dasherize__.{whatever}.{file extention}
ex:__name@dasherize__.test.ts
- Get back at root directory
- run
npm run rboth
- repeate actions from Getting started