I'm using angular-cli for generate new components, services and directives. When i create component(ng g c), generator make subfolder in src/app. And this is ok. But when i create directive (ng g d) or service (ng g s), generator create files into src/app. After few creations it looks very messy. Is it a way to generate this parts in a specific paths? For example src/app/directives/
1 Answer
Just do
ng g directive directives/directiveName It will create directive into src/app/directives
4 Comments
thigrand
It works, but you have to create folder. Generator create a folder for every component but not for directives. Could i change generator for that?
Yoann Prot
I didn't find any way to do it. On our project, we create directory manually
Yoann Prot
Angular-cli create the directory automatically now if it doesn't exist :)
thigrand
Yeah, i know that;) I finish few apps in ngX from that time.