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.
29 lines
603 B
JavaScript
29 lines
603 B
JavaScript
12 years ago
|
// Service for retrieving and caching application dependencies
|
||
11 years ago
|
angular.module('panelApp').
|
||
|
|
||
|
factory('appDeps', function (chromeExtension, $rootScope) {
|
||
12 years ago
|
|
||
|
var _depsCache = [];
|
||
|
|
||
|
// clear cache on page refresh
|
||
11 years ago
|
$rootScope.$on('refresh', function () {
|
||
12 years ago
|
_depsCache = [];
|
||
|
});
|
||
|
|
||
|
return {
|
||
|
get: function (callback) {
|
||
|
chromeExtension.eval(function (window) {
|
||
|
if (window.__ngDebug) {
|
||
|
return window.__ngDebug.getDeps();
|
||
|
}
|
||
|
},
|
||
|
function (data) {
|
||
|
if (data) {
|
||
|
_depsCache = data;
|
||
|
}
|
||
|
callback(_depsCache);
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
});
|