I noticed that the "lag" was whenever I replaced the scope value instead of 
mutating it. After changing my code to mutate the value, it works as 
expected:

http://plnkr.co/edit/321sY93jFLWvlpfU1EYk?p=preview

I'd still like to know why it makes a difference. I know that you can 
change the behavior of $watch to look at value equality vs reference 
equality. Maybe that's related to what's going on here. Clarification 
anyone?

On Friday, May 30, 2014 11:25:53 AM UTC-4, Ronnie Overby wrote:
>
> My problem is illustrated here:
> http://plnkr.co/edit/rbtGkGpjO88Rp0ZhoiOy?p=preview
>
> I have some directives that I've created to help me sort data.
>
> The sortModel directive has an isolate scope property "onSort" that allows 
> the developer to have some code executed when the sort interface is 
> interacted with.
>
> The value being passed into the function is lagging behind the actual 
> value by 1 iteration and only when not using the "multi-sort" feature. I'm 
> not really sure why.
>
> Please see my plunk for a demonstration of this behavior
>
> Thanks for any help.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to