Loading …
There was an error loading this resource. Please try again later.
 Improve this Doc

Error: $injector:cdep
Circular Dependency

Circular dependency found: $rootScope <- $timeout <- Notification <- $exceptionHandler <- $rootScope <- $translate

Description

This error occurs when the $injector tries to get a service that depends on itself, either directly or indirectly. To fix this, construct your dependency chain such that there are no circular dependencies.

For example:

angular.module('myApp', [])
.factory('myService', function (myService) {
  // ...
})
.controller('MyCtrl', function ($scope, myService) {
  // ...
});

When an instance of MyCtrl is created, the service myService will be created by the $injector. myService depends on itself, which causes the $injector to detect a circular dependency and throw the error.

For more information, see the Dependency Injection Guide.