Codiee
Codiee

Reputation: 3225

How do I find any unused dependency injections in an Angular Controller?

For example I injected $http, but I am not using it. How to find this is an unused dependency in any Angular method or tool?

Upvotes: 1

Views: 989

Answers (1)

piemonkey
piemonkey

Reputation: 751

I came here looking for a similar answer.

I've stumbled on something that might answer your question, using eslint-plugin-angular, which has a di-unused rule. This should highlight any removable dependencies for you.

I've not tried it myself as my problem is slightly different.

Upvotes: 1

Related Questions