In angularjs, given a module, how do you check if a directive/controller exists given a module.
I have a module and I want to know if some particular directives have bee
var controllers = []; _.each(app._invokeQueue, function(value, index) { if (value[0] !== '$controllerProvider') { return; } controllers.push(value[2][0]); }); if (controllers.indexOf('controller-i-want') === - 1) { // controller is undefined }