mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-12 19:29:42 +08:00
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
This commit is contained in:
@@ -2,3 +2,25 @@
|
||||
@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
|
||||
}]);
|
||||
```
|
||||
Reference in New Issue
Block a user