You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
angularjs-batarang/js/services/appDeps.js

27 lines
581 B
JavaScript

// Service for retrieving and caching application dependencies
panelApp.factory('appDeps', function (chromeExtension, appContext) {
var _depsCache = [];
// clear cache on page refresh
appContext.watchRefresh(function () {
_depsCache = [];
});
return {
get: function (callback) {
chromeExtension.eval(function (window) {
if (window.__ngDebug) {
return window.__ngDebug.getDeps();
}
},
function (data) {
if (data) {
_depsCache = data;
}
callback(_depsCache);
});
}
};
});