I don't think it would be supported by the API, but might there be a way to:

1. Get all injectables (services, factories, constants, etc)
2. Shim them with something that looks like:

var used = {};

for (var name in injectables) {
  used[name] = false;
}

function shim(name, realValue) {
  used[name] = true;
  return realValue;
}

module.controller('main', shim.bind(undefined, 'main', realMainController));

3. And then once the app was booted and running, print out what was still
false in the "used" dictionary?

This might be more work than just doing it manually, so it might not be
worth it. Also, as written it would break function parameter introspection.

On Thu, Sep 18, 2014 at 12:21 AM, 'Michael Bielski' via AngularJS <
[email protected]> wrote:

> It will help with identifying code that has no tests against it, but
> that's about all. In a situation like this, I tend to resort to the Find
> function of my IDE. I start with modules that I suspect are not being used
> and search for their injection points. If I find none, then I comment out
> the file in the index.html page and run the application (this is where E2E
> testing can really help.) If everything runs correctly, I remove the line
> from the index.html file, delete the module and the tests, and move on to
> the next one. Having been developing the app that is my main project at
> work for just over 2 years, this scenario has been played out a few times.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/ESzkqU04djY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to