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

Commit

Permalink
fix(ngOptionsDirective): use equals function if attr.multiple(to save…
Browse files Browse the repository at this point in the history
… performance issues)
  • Loading branch information
m-amr committed Nov 19, 2015
1 parent 1da0e0c commit eff8434
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ng/directive/ngOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
// Check to see if the value has changed due to the update to the options
if (!ngModelCtrl.$isEmpty(previousValue)) {
var nextValue = selectCtrl.readValue();
if (!equals(previousValue, nextValue)) {
var isNotPrimitive = ngOptions.trackBy || multiple;
if (isNotPrimitive? !equals(previousValue, nextValue) : previousValue !== nextValue) {
ngModelCtrl.$setViewValue(nextValue);
ngModelCtrl.$render();
}
Expand Down

0 comments on commit eff8434

Please sign in to comment.