I am currently working in a angular app in whcih I wanted to write an interceptor for all http request from my app which in turns calls a service to know whether the single
You can use interceptor very easily
Here is a sample
var mydevices = angular.module('deviceDetails', ['ui.bootstrap', 'tags-input'])
mydevices.config(function ($httpProvider) {
$httpProvider.interceptors.push(function($q) {
return {
'request': function(config) {
if (config.method === 'GET' && config.url.contains("/rest/")) {
var sep = config.url.indexOf('?') === -1 ? '?' : '&';
config.url = config.url + sep + 'cacheSlayer=' + new Date().getTime();
}
console.log(config.url);
return config || $q.when(config);
}
};
});
});
The example above modifies the URL for all /rest/ URLs
Hope this helps