Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngOptions): correctly watch displayed value for changes #11765

Closed
wants to merge 1 commit into from

Conversation

dremonkey
Copy link

ngOptions does not update the displayed value properly if the property being used as the label changes when not using the "select as" or "track by" syntax, i.e <select ng-options="value.label for value in array"></select> will not update if array[0].label is changed but <select ng-options="value.label as value.label for value in array></select> will correctly update.

The bug is demonstrated here: https://jsfiddle.net/76qrsctv/17/

The proposed change fixes this issue.

ngOptions does not update the displayed value properly if the property being used as the label changes when not using the "select as" or "track by" syntax.

The bug is demonstrated here: [https://jsfiddle.net/76qrsctv/17/](https://jsfiddle.net/76qrsctv/18/)

The proposed change fixes this issue.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@dremonkey
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@petebacondarwin
Copy link
Contributor

Thanks for highlighting this issue. We needed to provide a unit test too.

netman92 pushed a commit to netman92/angular.js that referenced this pull request Aug 8, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants