Questions tagged «angularjs-digest»

28
AngularJS:调用$ scope。$ apply()时防止错误$ digest已经在进行中
我发现自从以角度构建应用程序以来,我需要越来越多地手动将页面更新到我的范围。 我唯一知道的方法是$apply()从控制器和指令的范围进行调用。问题是它不断向显示以下内容的控制台抛出错误: 错误:$ digest已经在进行中 有谁知道如何避免这种错误或以不同的方式实现相同的目的?

10
$ apply已在执行中错误
堆栈跟踪: Error: $apply already in progress at Error (<anonymous>) at beginPhase (file:///android_asset/www/built.min.js:7:22740) at Object.Scope.$apply (file:///android_asset/www/built.min.js:7:25967) at navigator.geolocation.getCurrentPosition.that (file:///android_asset/www/built.min.js:13:8670) at Object.geolocation.getCurrentPosition (file:///android_asset/www/plugins/org.apache.cordova.core.geolocation/www/geolocation.js:122:13) at Object.getCurrentPosition (file:///android_asset/www/built.min.js:13:8589) at Object.getCurrentPosition (file:///android_asset/www/built.min.js:13:8277) at Object.getCurrentCity (file:///android_asset/www/built.min.js:13:8941) at Object.$scope.locateDevice (file:///android_asset/www/built.min.js:13:10480) at file:///android_asset/www/built.min.js:7:12292:7 参考此代码http://pastebin.com/B9V6yvFu getCurrentPosition: cordovaReady(function (onSuccess, onError, options) { navigator.geolocation.getCurrentPosition(function () { var that = this, args …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.