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