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

Rename `ngSwitchWhen` to `ngSwitchCase` #7571

Closed
userpixel opened this Issue Mar 12, 2016 · 4 comments

Comments

Projects
None yet
6 participants
@userpixel

userpixel commented Mar 12, 2016

  • *I'm submitting a ... *
    [ ] bug report
    [X] feature request
  • What is the current behavior?
<X ngSwitch]="...">
  <Y *ngSwitchWhen="..."></Y>
  <Y *ngSwitchWhen="..."></Y>
  <Y *ngSwitchWhen="..."></Y>
  <Z *ngSwitchDefault></Z>
</X>
  • What is the expected behavior?
<X ngSwitch]="...">
  <Y *ngSwitchCase="..."></Y>
  <Y *ngSwitchCase="..."></Y>
  <Y *ngSwitchCase="..."></Y>
  <Z *ngSwitchDefault></Z>
</X>

  • Please tell us about your environment:

It would be great to rename ngSwitchWhen to ngSwitchCase to keep it consistent with Javascript and Typescript switch/case keywords. From the first time I got to know angulat I've been wondering why it uses "when" instead of "case" where the "default" is used properly indeed. Just a syntactic sugar, but it would be great to fix it before Angular 2 is in production because then it would be almost impossible to change.

@robwormald

This comment has been minimized.

Member

robwormald commented Mar 13, 2016

this seems like a reasonable suggestion to me, and justifiable given we stick to ES6 semantics and left behind ng-repeat-in for ngForOf. @IgorMinar ?

@IgorMinar

This comment has been minimized.

Member

IgorMinar commented Mar 15, 2016

I agree. @mhevery can we put this on the rc list?

@gkalpak

This comment has been minimized.

Member

gkalpak commented Mar 15, 2016

(It will also be more consistent with NgPlural/NgPluralCase.)

@mhevery

This comment has been minimized.

Member

mhevery commented Mar 17, 2016

Yes, added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment