aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/error/injector/pget.ngdoc
blob: c195767a949b3a7d53feded7ebd9ffa34806c443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@ngdoc error
@name $injector:pget
@fullName Provider Missing $get
@description

This error occurs when attempting to register a provider that does not have a
`$get` method. For example:

```
function BadProvider() {} // No $get method!
angular.module("myApp", [])
  .provider('bad', BadProvider);  // this throws the error
```

To fix the error, fill in the `$get` method on the provider like so:

```
function GoodProvider() {
  this.$get = angular.noop;
}
angular.module("myApp", [])
  .provider('good', GoodProvider);
```

For more information, refer to the {@link api/AUTO.$provide#methods_provider
$provide.provider} api doc.