-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Labels
Description
If injected values are unused, this is mostly a result of forgetting to remove them.
The following should trigger a warning:
factory('example', function(dependency) {})
The following should not trigger a warning:
factory('example', function(dependency) {
return dependency;
})
factory('example', function(dependency) {
dependency();
})
factory('example', function(dependency) {
function nested() {dependency();}
})
The rule should apply to all places where dependencies may be injected:
- factories
- services
- controllers
- directives
- decorators
- run
- config
- providers
- providers
$get
function. - functions annotated with
/*@ngInject*/