diff --git a/js/inject/debug.js b/js/inject/debug.js index 5794f3f..6d96197 100644 --- a/js/inject/debug.js +++ b/js/inject/debug.js @@ -370,8 +370,6 @@ var inject = function () { var selectElt = angular.element(angular.element(popover.children('div')[0]).children()[2]); var closeElt = angular.element(angular.element(popover.children('div')[0]).children()[3]); - console.log(closeElt); - var currentScope = null, currentElt = null; @@ -631,16 +629,30 @@ var inject = function () { return tempGet.apply(this, arguments); }; }); + } else if (definition.$get instanceof Array) { + // it should have a $get + var tempGet = definition.$get[definition.$get.length - 1]; + + definition.$get[definition.$get.length - 1] = function () { + debug.deps.push({ + name: name, + imports: annotate(tempGet) + }); + return tempGet.apply(this, arguments); + }; } else if (typeof definition === 'object') { // it should have a $get var tempGet = definition.$get; - definition.$get = function () { + + // preserve original annotations + definition.$get = annotate(definition.$get); + definition.$get.push(function () { debug.deps.push({ name: name, imports: annotate(tempGet) }); return tempGet.apply(this, arguments); - }; + }); } else { debug.deps.push({ name: name,