i'm trying to update a scope list inside a callback function. This apparently works fine, but, after some seconds, console gets error: [$rootScope:infdig]. I tried to disable two-way databinding, but, the error continues.
Controller:
app.controller('ChapterCtrl', function ($rootScope, $scope, Services, chapter) {
$rootScope.headerTitle = chapter.name;
$scope.terms = [];
cctdbterms.webdb.getTermsByChapter(chapter.id, function(tx, results) {
$scope.terms = results.rows;
$scope.$apply();
});
});
View:
<div class="view" ng-repeat="term in terms">
<div ng-bind-html="term.description"></div>
</div>
The answer that a find is seraching is: "Problem was that the filter was providing a different array each time hence causing a loop" from Why do I get an infdig error?
Thinking about it, I solved in a simple way, interating my returning list: