scope.$watch doesn't work in conjunction with jQuery's fadeIn?

180 views
Skip to first unread message

Patrick Gillespie

unread,
May 31, 2013, 12:33:15 AM5/31/13
to ang...@googlegroups.com
If anyone has a moment, I'm completely stumped on this one. Check out this plunk with Chrome's console open:


When you click "Push!" for the first time, the watch function wont execute. But if you push it again, it will execute. It's like it ignores the first push. However, you can clearly see the dataPoints array changes after the first push due to the timeout function that is executing in the background. What's weirder, is if you comment out the jQuery fadeIn wrapper, the code works as expected.

What's going on here? Am I misunderstanding something?

Patrick Gillespie

unread,
May 31, 2013, 12:49:28 PM5/31/13
to ang...@googlegroups.com
In case anyone was interested, I ended up asking this on stackoverflow and someone figured out it was due to the callback not executing inside of Angular - http://stackoverflow.com/questions/16860385/angularjss-scope-watch-function-is-not-firing-on-data-modification
Reply all
Reply to author
Forward
0 new messages