devkit
devkit copied to clipboard
bug(schematics): component changeDetectionStrategy alias -c clashes with --collection alias shorthand
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Area
- [] devkit
- [x] schematics
Versions
Node: 8.10 Npm: 5.7.1 OS: High Sierra
Repro steps
When creating custom schematic and extending from current @schematics/[email protected] for custom component blueprint, alias for changeDetection is c, which clashes with --collection shorthand alias
yarn ng g myc helloWorld -c=OnPush -d -c @martin_hotell/schematics
- myc : is custom blueprint for component which uses the same collection metadata as current
@schematic/angular
The log given by the failure

Desired functionality
There are multiple typos fro aliases names within component blueprint
- changeDetection : https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L55
- viewEncapsulation: https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L48
- inlineTemlate: https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L42
- inlineStyle: https://github.com/angular/devkit/blob/master/packages/schematics/angular/component/schema.json#L36
before, the aliases were different
cdnotcitnottisnotsvenotv
I can send PR, if you want.
Thanks
This bug is super annoying, since it takes some time to figure out, why ng g c helloWorld doesn't work anymore.
This issue was moved to angular/angular-cli#12132