So I have service with two methods. I am using built-in cache support for $resource. What i want to achieve is when i make some service call from controller to refresh cache. I was trying some example with $cacheResource but no success. Below is my code
Service
angular.module('module').factory('Service1',['$resource',
function ($resource){
return $resource('..api/latest/myservice', {}, {
takeSomething: {
method: 'GET',
url: '..api/latest/myservice/takesomething',
cache: true
},
putSomething: {
method: 'GET',
url: '..api/latest/myservice/putsomething',
cache: true
}
}
}]
Controller
angular.module('module').factory('MyController',['$scope','Service1',
function($scope, service1) {
....
$scope.update = function() {
service1.putSomething({
......
refresh cache for takeSomething method in service or for all methods
});
}
}
So when i call this function update from controller i want to refresh cache for takeSomething methods or for all methods.