While testing my app on Chrome browser, I encountered an issue with clearing old views and cache. This is the process I followed to sign out of my app:
https://i.stack.imgur.com/EGgRx.png
Upon clicking Log out, the following code is executed:
Auth.$signOut().then(function(){
$ionicHistory.nextViewOptions({
disableBack: true,
historyRoot: true
});
$ionicHistory.clearHistory();
$ionicHistory.clearCache();
$state.go('login');
});
Although this method works, when attempting to log in again from the login page, the following code runs:
$ionicHistory.nextViewOptions({
disableBack: true
});
$ionicHistory.clearHistory();
$ionicHistory.clearCache();
$state.go("menu.myReports");
While this also works, the previous view before logging out is still visible:
https://i.stack.imgur.com/VtdeW.png
Instead, I want to completely clear all history, cache, or any other remnants upon signing out. Is this achievable? My database is using AngularFire.