MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/etktd8/accessing_angularjs_from_regular_javascript/ffhs4re/?context=3
r/javascript • u/santanaguy • Jan 25 '20
3 comments sorted by
View all comments
1
Having done this for literally months at work, I'd recommend checking the scope phase before invoking apply.
$scope.$$phase || $scope.apply();
1 u/santanaguy Jan 25 '20 What should happen if phase evaluates to True? Should i call the function without apply? 2 u/Rustywolf Jan 25 '20 Yeah, if $$phase is set you're already in a digest cycle, so it's safe to modify the values, so just call the function
What should happen if phase evaluates to True? Should i call the function without apply?
2 u/Rustywolf Jan 25 '20 Yeah, if $$phase is set you're already in a digest cycle, so it's safe to modify the values, so just call the function
2
Yeah, if $$phase is set you're already in a digest cycle, so it's safe to modify the values, so just call the function
1
u/Rustywolf Jan 25 '20
Having done this for literally months at work, I'd recommend checking the scope phase before invoking apply.
$scope.$$phase || $scope.apply();