$ionicHistory.clearCache() doesn't work


#1

Hi guys,
When i used $ionicHistory.clearCache(); with clearHistory, app is getting stuck and can’t do any thing. Is there any work around to clear cache with out using cache-view=“false”.
what i need is, cache the pages and then remove that cache when i am logging out.

Cheers.


#2

Hi there, maybe with this:

 $ionicConfigProvider.views.maxCache(0);

Cheers


#3

but it should be placed in side .config, i want something that can run inside controller


#4

After 1.1.0 clearCache now returns a promise so you should do the following

$ionicHistory.clearCache().then(function(){
      //do something  
});

#5

I update my ionic version in project now the above function works. Thank you @sindri