1. 退出后重新登录,默认方法不执行,没有重新获取数据。
原因:$ionicHistory中的数据未清理,留有缓存
解决方法: 退出或是重新登录时进行历史缓存清理
$ionicHistory.clearCache()
2. 清理 view cache (from statckOverflow : Is it possible to clear the view cache in Ionic? http://stackoverflow.com/questions/28676631/is-it-possible-to-clear-the-view-cache-in-ionic )
i. If you're already on the page, you can do,
$state.go($state.currentState, {}, {reload:true})
ii. If you're on another state and want to go back to
the state that is normally cached but you want it
$ionicHistory.clearCache().then(function(){
$state.go('app.fooState') })