Currently, the Angular CLI creates a new component by default in the app/{componentName}/
folder.
Is it possible to configure such that the cli will instead generate new component folders in app/components/{componentName}/
folder?
I tried messing around with some variables in the angular-cli.json but with no luck.
There is nothing like that in place in the CLI for a persistent value. The reason for this is that the style guide suggests not placing all like entities (i.e. components, services) in a grouped directory.
With that being said to achieve this you have two options...
app/components/
and generate from there. The CLI will know your current directory and create relative to that directorysrc
dir) you can specify ng generate component components/foo
which will include "components" in the path of where the component is generated.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With