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.
27 lines
599 B
JavaScript
27 lines
599 B
JavaScript
// Service for retrieving and caching application dependencies
|
|
angular.module('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);
|
|
});
|
|
}
|
|
};
|
|
});
|