I am new to Angular JS. I am done with my project. but somewhere I need to play with browser cache. Sometimes API gives me 400 Error code. and if I clear cache then it works fine.

I am done with following that did not work.

  1. F12 - disable cache. { this is good at development user side it is not}
  2. applied query string to my js files.
  3. applied $templatecache related code.
  4. if anyone have any idea about that. please share.
share|improve this question

If you want to remove cached views from the code.

app.run(function($rootScope, $templateCache) {
    $rootScope.$on('$routeChangeStart', function(event, next, current) {
        if (typeof(current) !== 'undefined'){
            $templateCache.remove(current.templateUrl);
        }
    });
});
share|improve this answer
    
Tried this but not resolving my $http cache issue. – SVP 41 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.