Create caching of http request in angular for speedy load
'use strict';
/**
* @ngdoc function
* @name yeomanSassApp.controller:LinksCtrl
* @description
* # LinksCtrl
* Controller of the yeomanSassApp
*/
var app = angular.module('yeomanSassApp');
app.controller('LinksCtrl', ['$scope', '$http', 'ENV', 'HandleError', function($scope, $http, ENV, HandleError) {
$scope.filters = { };
//Get Links Json
$http.get(ENV.apiEndpoint + '/rest/usefulLink/', {
cache: true,
params: {
apiToken: ENV.apiToken
}
}).success(function(data) {
$scope.links =data.response.docs;
}).error(function() {
new HandleError();
});
}]);