X Tutup
Skip to content

fix(select): update option value name from ng-value to ngValue#7939

Closed
kara wants to merge 1 commit intoangular:masterfrom
kara:selectfix
Closed

fix(select): update option value name from ng-value to ngValue#7939
kara wants to merge 1 commit intoangular:masterfrom
kara:selectfix

Conversation

@kara
Copy link
Copy Markdown
Contributor

@kara kara commented Apr 6, 2016

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Changes name of option value binding from ng-value to ngValue.
  • What is the current behavior? (You can also link to an open issue here)
    Old code you'd write for option values that are objects:
<select [(ngModel)]="selectedCity">
   <option *ngFor="#city of cities" [ng-value]="city">{{city.name}}</option>
</select>
class MyComp {
   selectedCity: Object;
   cities: Object[] = [
      {name: "SF"},
      {name: "NYC"}
   ];
}
  • What is the new behavior (if this is a feature change)?

New code you'd write for option values that are objects:

<select [(ngModel)]="selectedCity">
   <option *ngFor="#city of cities" [ngValue]="city">{{city.name}}</option>
</select>
class MyComp {
   selectedCity: Object;
   cities: Object[] = [
      {name: "SF"},
      {name: "NYC"}
   ];
}
  • Does this PR introduce a breaking change?

Yes, technically, but ng-value was introduced 10 minutes ago.

@mary-poppins
Copy link
Copy Markdown

Merging PR #7939 on behalf of @kara to branch presubmit-kara-pr-7939.

@mhevery mhevery closed this in 3ca6df8 Apr 6, 2016
@khurram900
Copy link
Copy Markdown

You really did a great work. Thank you so much.

@kara kara deleted the selectfix branch October 13, 2018 01:08
@angular-automatic-lock-bot
Copy link
Copy Markdown

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: forms cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup