g-viet / til

Today I learned
6 stars 0 forks source link

Angular: using applyAsync() instead of apply() for avoiding "$digest in progress" #87

Open g-viet opened 5 years ago

g-viet commented 5 years ago

Sometimes we got this when trying running $scope.apply() manually:

Error: $digest already in progress

There are 2 ways to solve this:

But we should avoid using $scope.apply() manually, it is easy to crash