Skip to content

Commit

Permalink
Cached data to avoid multiple requests - Fix #83
Browse files Browse the repository at this point in the history
  • Loading branch information
mitogh committed Jun 22, 2016
1 parent 2e1d504 commit f0e1a4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/molecules/admin-bar/admin-bar.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ function lnMAdminBarService($rootScope, $q, $http) {

function getAdminBarData() {
var deferred = $q.defer();
var options = {
withCredentials: true,
cache: true,
};

$http
.get(apiUrl, { withCredentials: true })
.get(apiUrl, options)
.then(function (response) {
return deferred.resolve(response);
}, function (error) {
Expand All @@ -36,4 +40,4 @@ function lnMAdminBarService($rootScope, $q, $http) {

return deferred.promise;
}
}
}

0 comments on commit f0e1a4c

Please sign in to comment.