Saturday, 15 June 2013

AngularJS $watch: 10 $digest() iterations reached -


I have a service that works for me todo app it has getActive () and getCompleted () are methods that return respectively the active and full method.

forced me to show numbers, active and $ watch

  $ scope.active = taskss.getActive ( ). Length; $ Scope.completed = taskss.getCompleted (). Length; $ Scope $ Clock (operationalising. Work, Work () {$ scope.active = taskss.getActive (). Length;}); $ Scope $ Watch (tasks.getCompleted, function () {$ scope.completed = taskss.get full (). Length;});   

It works fine, but it throws too many errors into the console, whenever I change the job status or delete it.

  Ankyut error: $ 10 Digest () being revoked reached iterations! Hidden watchers in the last 5 iterations:    

I think you need those clocks is not . In AngularJS, most expressions are updated on the fly, so that you can use taskss.getCompleted (). Length directly, such as:

  $ scope.active = function () {return taskss.getActive (). Length; }; $ Scope.completed = function () {return taskss.getCompleted (). Length; };   

For 10 digest errors, see.

No comments:

Post a Comment