Joined August 2012
·
Posted to
'Safe' $apply in Angular.JS
over 1 year
ago
@digger69 I have considered it and have been looking through repository to see where it would best fit. I'll update this thread once I submit a pull request.
Posted to
'Safe' $apply in Angular.JS
over 1 year
ago
@roypeled Thanks for the note, I hadn't realized apply could be called without a parameter. I've updated by original code to take that into account.
Achievements
1,682 Karma
142,175 Total ProTip Views

Beaver 3
Have at least three original repo where go is the dominant language

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Beaver
Have at least one original repo where go is the dominant language

Forked
Have a project valued enough to be forked by someone else

Charity
Fork and commit to someone's open source project in need

Honey Badger
Have at least one original Node.js-specific repo

Nephila Komaci
Have at least one original repos where PHP is the dominant language
@marklagendijk That will likely work the vast majority of the time, though, in my experience, if you're responding to tons of events (such as a video feed), it still has the potential to result in multiple digests/applies.
More importantly, it results in your code being called after the current process thread. For many situations that may be preferable (particularly when doing DOM binding, such as with a jQuery plugin), but if you intend to immediately use any of the variables you just worked on, it will cause problems.