forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ngOptions): iterate over the options collection in the same way a…
…s `ngRepeat` In `ngRepeat` if the object to be iterated over is "array-like" then it only iterates over the numerical indexes rather than every key on the object. This prevents "helper" methods from being included in the rendered collection. This commit changes `ngOptions` to iterate in the same way. BREAKING CHANGE: Although it is unlikely that anyone is using it in this way, this change does change the behaviour of `ngOptions` in the following case: * you are iterating over an array-like object, using the array form of the `ngOptions` syntax (`item.label for item in items`) and that object contains non-numeric property keys. In this case these properties with non-numeric keys will be ignored. ** Here array-like is defined by the result of a call to this internal function: https://github.com/angular/angular.js/blob/v1.4.0-rc.1/src/Angular.js#L198-L211 ** To get the desired behaviour you need to iterate using the object form of the `ngOptions` syntax (`value.label` for (key, value) in items)`). Closes angular#11733
- Loading branch information
1 parent
cc96188
commit dfa722a
Showing
2 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters