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

fix(select): don't call $render twice if $viewValue ref changes #11412

Closed
wants to merge 1 commit into from

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Mar 24, 2015

Credits to @tepez for the fix

Closes #11329

@@ -200,11 +200,13 @@ var selectDirective = function() {

// we have to do it on each watch since ngModel watches reference, but
// we need to work of an array, so we need to see if anything was inserted/removed
var lastView, lastViewRef = NaN;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lastView is already declared up top isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True - now that I see it, isn't it a bit weird that it is defined outside the link fn? So every selectDirective uses the same variable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree so I moved it inside.

@Narretz Narretz closed this in 7e5c447 Mar 25, 2015
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

select multi: $render is called twice when $viewValue reference changes
3 participants