javascript - 如何在 Angular.js 中找到哪一行代码触发了 $digest 已经在进行中

标签 javascript angularjs

我有一个在浏览器控制台中报告错误的 Angular.js 应用程序:

Error: [$rootScope:inprog] $digest already in progress

你能告诉我如何找到触发此错误的代码吗?

更新:

这是我的堆栈跟踪:

Error: [$rootScope:inprog] $digest already in progress http://errors.angularjs.org/1.2.0-rc.3/$rootScope/inprog?p0=%24digest at http://localhost:3000/js/libs/angular.js/angular.js:78:12 at beginPhase (http://localhost:3000/js/libs/angular.js/angular.js:10995:15) at Scope.$apply (http://localhost:3000/js/libs/angular.js/angular.js:10795:11) at HTMLInputElement.<anonymous> (http://localhost:3000/js/libs/angular.js/angular.js:16514:17) at http://localhost:3000/js/libs/angular.js/angular.js:2331:10 at Array.forEach (native) at forEach (http://localhost:3000/js/libs/angular.js/angular.js:213:11) at HTMLInputElement.eventHandler (http://localhost:3000/js/libs/angular.js/angular.js:2330:5) at scroll (http://localhost:3000/js/libs/angular.js/angular.js:3479:26) at http://localhost:3000/js/libs/angular.js/angular-route.js:852:15 angular.js:8296

最佳答案

您有两个选择。二进制搜索,即将应用程序切成两半并检查错误何时停止。然后专注于此。

或者进入 Angular 源并在报告的行中放置一个断点。然后使用调用堆栈进行回溯。

这两种选择最终都可能很耗时,但我会从调用堆栈开始。祝你好运。

关于javascript - 如何在 Angular.js 中找到哪一行代码触发了 $digest 已经在进行中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19505944/

相关文章:

javascript - 如何检索 Summernote 的内容?

javascript - 使用 axios 执行经过身份验证的请求时,Jest 返回 "Network Error"

javascript - D3 指令 - 路径值无效导致错误

angularjs - ionic 应用程序不允许访问照片数据

javascript - 如何在 html 中使用 ng-repeat 和索引

javascript - Webflow 和 Fullpage.js 互相干扰

javascript - 改变 React 状态对象中的值

javascript - AngularJS + Bootstrap - 将 $compiled HTML 注入(inject) popover

javascript - AngularJS ex.com/forum?id=1 到 ex.com/#/forum?id=1

php - 如何将值插入MySQL表的特定空白列?