$apply already in progress error

后端 未结 11 1263
暗喜
暗喜 2020-11-29 17:53

Stack trace:

Error: $apply already in progress
at Error ()
at beginPhase (file:///android_asset/www/built.min.js:7:22740)
at Object.Scope.$a         


        
11条回答
  •  悲&欢浪女
    2020-11-29 18:19

    You are getting this error because you are calling $apply inside an existing digestion cycle.

    The big question is: why are you calling $apply? You shouldn't ever need to call $apply unless you are interfacing from a non-Angular event. The existence of $apply usually means I am doing something wrong (unless, again, the $apply happens from a non-Angular event).

    If $apply really is appropriate here, consider using a "safe apply" approach:

    https://coderwall.com/p/ngisma

提交回复
热议问题