mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 15:40:22 +00:00
17 lines
727 B
Text
17 lines
727 B
Text
@ngdoc error
|
|
@name $rootScope:infdig
|
|
@fullName Infinite $digest Loop
|
|
@description
|
|
|
|
This error occurs when the application's model becomes unstable and each `$digest` cycle triggers a state change and subsequent `$digest` cycle.
|
|
Angular detects this situation and prevents an infinite loop from causing the browser to become unresponsive.
|
|
|
|
For example, the situation can occur by setting up a watch on a path and subsequently updating the same path when the value changes.
|
|
|
|
```
|
|
$scope.$watch('foo', function() {
|
|
$scope.foo = $scope.foo + 1;
|
|
});
|
|
```
|
|
|
|
The maximum number of allowed iterations of the `$digest` cycle is controlled via TTL setting which can be configured via {@link api/ng.$rootScopeProvider $rootScopeProvider}.
|