Scenario
We wish to generate a standalone CustomerComponent
using the Angular CLI.
Approach
ng g component --standalone Customer
To generate all components with the standalone flag without having to specify it update angular.json
.
"schematics": {
"@schematics/angular:component": {
"standalone": true
}
}
This also works for directive
and pipe
schematics.