Show / Hide Table of Contents
-
Error Reference
- $animate
- notcsel
- $cacheFactory
- iid
- $compile
- ctreq
- iscp
- multidir
- nodomevents
- nonassign
- selmulti
- tpload
- tplrt
- uterdir
- $controller
- noscp
- $http
- badreq
- $injector
- cdep
- itkn
- modulerr
- nomod
- pget
- strictdi
- undef
- unpr
- $interpolate
- interr
- noconcat
- $location
- ihshprfx
- ipthprfx
- isrcharg
- nobase
- nostate
- $parse
- isecdom
- isecff
- isecfld
- isecfn
- isecobj
- isecwindow
- lexerr
- syntax
- ueoe
- $q
- norslvr
- qcycle
- $resource
- badargs
- badcfg
- badmember
- badname
- $rootScope
- infdig
- inprog
- $sanitize
- badparse
- $sce
- icontext
- iequirks
- imatcher
- insecurl
- itype
- iwcard
- unsafe
- jqLite
- nosel
- offargs
- onargs
- ng
- areq
- badname
- btstrpd
- cpi
- cpws
- ngModel
- constexpr
- datefmt
- nonassign
- ngOptions
- iexp
- trkslct
- ngPattern
- noregexp
- ngRepeat
- badident
- dupes
- iexp
- iidexp
- ngTransclude
- orphan
Loading...
Improve this Doc
Error: error:cdep
Error: error:cdep
Circular Dependency
Circular dependency found: {0}
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.