using ng g c user-create will generate app/user-create/user-create.* files.
My suggestion is to generate app/user/create.*, it's pattern is "object/action", most of routers are same as this, especially CRUD style routers: app/user/create.*, app/user/edit.*, app/user/list.*, etc.
furthermore: ng g c order-form-create should generate app/order-form/create.* because few actions are compounds.
It would be better to do something like ng g c order-form/create if you want to do that.
Your suggestion will cause confusion and unexpected behavior.
although ng g c order-form/create hasn't this confusion, but how to generate the class name and the selector of component?
I think we should use / to specify sub-directory, so that we can stay in root directory(no need cd xxx) and run ng commands. it's very useful to zsh terminal.
The way it is currently is fine and expected behavior. You want to support
a specific convention based on your own preference. I disagree with that
preference and it does not follow the style guidelines.
In your example, I would want the file, selecto,r and class name to be
order-form-create if I did 'ng g c order-form-create'.
I wanted it to be under an order-form directory I would expect either to
make the folder and CD inside it or expect 'ng g c
order-form/order-form-create' to do it.
On Wed, Sep 7, 2016, 11:33 PM 雪狼 [email protected] wrote:
although ng g c order-form/create hasn't this confusion, but how to
generate the class name and the selector of component?I think we should use / to specify sub-directory, so that we can stay in
root directory(no need cd xxx) and run ng commands. it's very useful to
zsh terminal.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular-cli/issues/2015#issuecomment-245506469,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA3YJQUWCbLvHXgeuYLe3cY0xuOG10Psks5qn6wkgaJpZM4J3goj
.
We opted for the folder abstraction in the commands. I don't think we could change that (or mix both) without causing a great deal of confusion.
Sorry for a long leave from here.
I vote to don't change it currently.
But I have something more to talk about this.
Let's say there are 10 entities and each of them have 4 actions(CRUD), there will be 10*4 = 40 folders in the same level, and 4 files each folder. I think it's not a good idea.
In my structure it have 10 folders and 16 files each folder. I think it's better in this case.
and even for 1 entity and 4 actions, It's clearly enough too.
BTW: Sorry for I can't write in English very clearly and exactly.
I understand how your usecase would benefit from it, but it's a little too specific to be a major change to the CLI.
We do have plans for an addon system, perhaps it could allow you to add new commands like the one you need. It'll take time until we have it up and functional though.
Yes, I agree! It's priority is very low.
My ideal architecture of CLI is separate to Dev Server, Build Utils and Generator. I love the AngularClass's starter and also I love CLI's generator.
I'll try to fork and work on it when I have more time.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
The way it is currently is fine and expected behavior. You want to support
a specific convention based on your own preference. I disagree with that
preference and it does not follow the style guidelines.
In your example, I would want the file, selecto,r and class name to be
order-form-create if I did 'ng g c order-form-create'.
I wanted it to be under an order-form directory I would expect either to
make the folder and CD inside it or expect 'ng g c
order-form/order-form-create' to do it.
On Wed, Sep 7, 2016, 11:33 PM 雪狼 [email protected] wrote: