$apply already in progress error

后端 未结 11 1269
暗喜
暗喜 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:16

    We can use setTimeout function in such cases.

    console.log('primary task');
    
    setTimeout(function() {
      
      console.log('secondary task');
    
    }, 0);
    
    

    This will make sure that secondary task will be executed when execution of primary task is finished.

提交回复
热议问题