myModule.config(['$httpProvider', function ($httpProvider) { $httpProvider.interceptors.push('noCacheInterceptor'); }]).factory('noCacheInterceptor', function () { return { request: function (config) { console.log(config.method); console.log(config.url); if (config.method == 'GET') { var separator = config.url.indexOf('?') === -1 ? '?' : '&'; config.url = config.url + separator + 'noCache=' + new Date().getTime(); } console.log(config.method); console.log(config.url); return config; } }; });
myApp.run(function ($rootScope, $templateCache) { $rootScope.$on('$viewContentLoaded', function () { $templateCache.removeAll(); }); });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)