0
在這段代碼中,我有兩種方法告訴我的應用程序不緩存所有視圖,選項A和B表示,你推薦哪一個,爲什麼?避免在IONIC上緩存頁面
選項A:
.config(function ($ionicConfigProvider, $urlRouterProvider, $httpProvider) {
$ionicConfigProvider.backButton.icon('ion-chevron-left');
$ionicConfigProvider.backButton.previousTitleText(false).text(' ');
$httpProvider.interceptors.push('httpInterceptor');
$httpProvider.interceptors.push('authInterceptor');
$ionicConfigProvider.views.maxCache(0);
})
選項B:
.run(function ($ionicPlatform, $ionicConfig) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
$ionicConfig.views.maxCache(0);
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.styleDefault();
}
});
})