mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
docs(error/$injector/unpr): clarify which code is being referred to in the text
Closes #7020
This commit is contained in:
committed by
Peter Bacon Darwin
parent
510c328d74
commit
6c3a0519fa
@@ -14,8 +14,9 @@ angular.module('myApp', [])
|
||||
}]);
|
||||
```
|
||||
|
||||
This code will fail with `$injector:unpr` if `myService` is not defined. Making
|
||||
sure each dependency is defined will fix the problem.
|
||||
The above code will fail with `$injector:unpr` if `myService` is not defined.
|
||||
|
||||
Making sure each dependency is defined will fix the problem, as noted below.
|
||||
|
||||
```
|
||||
angular.module('myApp', [])
|
||||
@@ -23,4 +24,4 @@ angular.module('myApp', [])
|
||||
.controller('MyController', ['myService', function (myService) {
|
||||
// Do something with myService
|
||||
}]);
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user