Generating Standalone Angular Components


Image by Pexels from Pixabay


We wish to generate a standalone CustomerComponent using the Angular CLI.


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.



Ole Ersoy

Founder of Firefly Semantics Corporation