$ionicHistory.clearCache() doesn't work

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.

Hi there, maybe with this:

 $ionicConfigProvider.views.maxCache(0);

Cheers

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

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

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

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