I know this can false the cache in particular state or view
Disable cache within state provider
$stateProvider.state('myState', {
cache: false,
url : '/myUrl',
templateUrl : 'my-template.html'
})
Disable cache with an attribute
<ion-view cache-view="false" view-title="My Title!">
...
</ion-view>
But i need to false the cache from a specific view transition for example
$state.go('home',{cache: false});
here i have to false the home state cache, I tried this but not working yet
The first time a template is used, it is loaded in the template cache for quick retrieval. You can use $templateCache
service directly to add your Template in cache or to remove it from cache. Try below example
app.run(function($rootScope, $templateCache) {
$rootScope.$on('$routeChangeStart', function(event, next, current) {
if (typeof(current) !== 'undefined'){
$templateCache.remove(current.templateUrl);
}
//Or if you want to remove next state from cache
if (typeof(next) !== 'undefined'){
$templateCache.remove(next.templateUrl);
}
.....
});
}