Skip to content
ProLoser edited this page Mar 28, 2013 · 1 revision

Want to cachebust those ng-include and templateUrl assets? Check out this solution:

myAppModule.config(['$routeProvider', '$provide', function($routeProvider, $provide) {
  $provide.decorator('$http', ['$delegate', function($delegate){
    var get = $delegate.get;
    $delegate.get = function(url, config){
      url += (url.indexOf('?') !== -1) ? '?' : '&';
      url += 'v=' + cacheBustVersion;
      return get(url, config);
    };
  return $delegate;
}]);