-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate file names with types by writing a dot instead of an extra spaced type parameter #2155
Comments
I think it's more intuitive to just do |
I prefer to leave it with the space, but understand the case for the The reason I prefer the space is because you are defining two different things.
They are separate because the name of the class is used in both the class name and the file name where the type is **only* part of the file name. I just feel like the space is a clearer separation when generating a class. |
@Brocco I see your point, and it's a valid one. As I wrote, I think the dot notation will be the first intuitive thing newcomers will try, because this is how you usually create regular files outside of the cli, also how you are use to @hansl @Brocco was there a technical reason it isn't possible like @filipesilva remembers? |
That was it actually - the class name, within the file. We can't discern if 'hero-name.villain.model' should be class HeroNameVillain or HeroNameVillainModel. |
But currently, it is being ignored anyway (as I stated in my first comment) I think it is reasonable to ignore what after the dot for classes, as they are too general and not part of the Angular world. |
I'll fall back to my original statement... I'm good with the idea of adding the |
Doing Maybe that's the way to go, class name is up to first dot, filename is everything. |
I can concede to this. |
Closes angular#2155 BREAKING CHANGE: The ability to specify a class type via an additional arg has been replaced by combining the name and type args separated by a dot
Closes angular#2155 BREAKING CHANGE: The ability to specify a class type via an additional arg has been replaced by combining the name and type args separated by a dot
Closes #2155 BREAKING CHANGE: The ability to specify a class type via an additional arg has been replaced by combining the name and type args separated by a dot
Thanks @Brocco ! |
Closes #2155 BREAKING CHANGE: The ability to specify a class type via an additional arg has been replaced by combining the name and type args separated by a dot
Closes angular#2155 BREAKING CHANGE: The ability to specify a class type via an additional arg has been replaced by combining the name and type args separated by a dot
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I've tried to generate a new model class by running
ng generate class hero/here.model
But it generated -
hero/hero.ts
and ignored what was after the dot.@Brocco told me that it's because we should pass the "type" parameter with a space and not with a dot, like this -
ng generate class hero/here model
I think that writing the file name as I want it to be (with the dot) is much more intuitive and not making developers go and read the docs to figure out what happened to their precious type :)
With not ignoring the "dot type" for the filename (but do ignoring it for the Class name), it'll just work more intuitively IMO.
Mike suggested to maybe we should have both options, after thinking about it I think it's always better to have just one choice rather than two, to minimize confusion and redundant documentation.
@hansl , @filipesilva , @Brocco I'm interested to hear what you think?
Does this make sense? if so, should we keep them both (dot and space) or just one?
Once we'll figure it out, I'll create the PR
Thanks!
The text was updated successfully, but these errors were encountered: