aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/error/injector/cdep.ngdoc
diff options
context:
space:
mode:
authorKen Sheedlo2013-08-01 15:11:10 -0700
committerIgor Minar2013-08-07 21:36:59 -0700
commite4b6a1eaa4a432b0082c7abbff8f4bb169cf846e (patch)
treec7db8a10cfa64808ac3d750d7d434cbf05c5ea64 /docs/content/error/injector/cdep.ngdoc
parent306a613440175c7fd61d1d6eb249d1e53a46322e (diff)
downloadangular.js-e4b6a1eaa4a432b0082c7abbff8f4bb169cf846e.tar.bz2
docs(minerr): fill in error message descriptions
Errors I've documented so far: - `$injector:cdep` - `$injector:itkn` - `$injector:modulerr` - `$injector:nomod` - `$injector:pget` - `$injector:unpr` - `ng:areq` - `ng:cpi` - `ng:cpws` - `ngModel:noass` Closes #3430
Diffstat (limited to 'docs/content/error/injector/cdep.ngdoc')
-rw-r--r--docs/content/error/injector/cdep.ngdoc22
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/content/error/injector/cdep.ngdoc b/docs/content/error/injector/cdep.ngdoc
index f4a9c909..0e9769c4 100644
--- a/docs/content/error/injector/cdep.ngdoc
+++ b/docs/content/error/injector/cdep.ngdoc
@@ -2,3 +2,25 @@
@name $injector:cdep
@fullName Circular Dependency
@description
+
+This error occurs when the {@link api/angular.injector $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 {@link guide/di Dependency Injection Guide}. \ No newline at end of file