如何避免$digest正在进行中的错误

How to avoid $digest already in progress error

本文关键字:进行中 错误 何避免 digest      更新时间:2023-09-26

在我的angularjs应用程序中,我有这些代码行

getGridPage('api/accounts/gettransactions') //$http call to server which sets the $scope
$scope.transactions = {}

我得到$digest已经在进行中的错误。我怎样才能避免它?

getGridPage()的某个地方,你打电话给scope.$apply()scope.$digest。摆脱该呼叫,错误将消失。