Safely Prevent Template Caching in AngularJS [team]

posted in: AngularJS | 0

AngularJS’s $templateCache can be a pain in the ass. Sometimes we don’t want templates to be cached. With the UI Bootsrap module, a┬ásolution is to remove new cache entries on route change instead of indiscriminately removing all entries:$rootScope, $templateCache) {
    $rootScope.$on('$routeChangeStart', function(event, next, current) {
        if (typeof(current) !== 'undefined'){

Leave a Reply