angular.js/docs/content/error/injector/unpr.ngdoc
Ken Sheedlo e4b6a1eaa4 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
2013-08-07 21:36:59 -07:00

26 lines
No EOL
712 B
Text

@ngdoc error
@name $injector:unpr
@fullName Unknown Provider
@description
This error results from the `$injector` being unable to resolve a required
dependency. To fix this, make sure the dependency is defined and spelled
correctly. For example:
```
angular.module('myApp', [])
.controller('myCtrl', ['myService', function (myService) {
// Do something with myService
}]);
```
This code will fail with `$injector:unpr` if `myService` is not defined. Making
sure each dependency is defined will fix the problem.
```
angular.module('myApp', [])
.service('myService', function () { /* ... */ })
.controller('myCtrl', ['myService', function (myService) {
// Do something with myService
}]);
```