angular.js - About $apply()
天蓬老师
天蓬老师 2017-05-15 16:54:08
0
1
530


I keep getting errors after using $apply, please answer

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
漂亮男人

This error is Digest Already In Progress。原因在于$digest循环已经在执行了,你再次手动调用了$applyfunction.

Just remove the redundant call, you can also $apply时判断是否已经在$digest:

javascriptif(!$scope.$$phase) {
    $scope.$apply();
}

Look at this question: http://stackoverflow.com/questions/12729122/prevent-error-digest-alrea...

If you don’t know what $digest is, refer to this article:
http://harttle.github.io/2015/06/06/angular-data-binding-and-digest.ht...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template