GUAC-1126 Add caching of GET requests in REST API services.

This commit is contained in:
James Muehlner
2015-04-08 22:35:18 -07:00
parent 5eb4ab99c6
commit 91b0d72a60
6 changed files with 165 additions and 24 deletions

View File

@@ -23,9 +23,14 @@
/**
* Service for operating on protocol metadata via the REST API.
*/
angular.module('rest').factory('protocolService', ['$http', 'authenticationService',
function protocolService($http, authenticationService) {
angular.module('rest').factory('protocolService', ['$injector',
function protocolService($injector) {
// Required services
var $http = $injector.get('$http');
var authenticationService = $injector.get('authenticationService');
var cacheService = $injector.get('cacheService');
var service = {};
/**
@@ -46,6 +51,7 @@ angular.module('rest').factory('protocolService', ['$http', 'authenticationServi
// Retrieve available protocols
return $http({
cache : cacheService.protocols,
method : 'GET',
url : 'api/protocols',
params : httpParameters