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

Commit 4613a73

Browse files
committed
fix(ngOptionsDirective): use equals function if attr.multiple(to save performance issues)
1 parent 1da0e0c commit 4613a73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ng/directive/ngOptions.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,8 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
733733
// Check to see if the value has changed due to the update to the options
734734
if (!ngModelCtrl.$isEmpty(previousValue)) {
735735
var nextValue = selectCtrl.readValue();
736-
if (!equals(previousValue, nextValue)) {
736+
var isNotPrimitive = ngOptions.trackBy || multiple;
737+
if (isNotPrimitive ? !equals(previousValue, nextValue) : previousValue !== nextValue) {
737738
ngModelCtrl.$setViewValue(nextValue);
738739
ngModelCtrl.$render();
739740
}

0 commit comments

Comments
 (0)