您的位置:首页 > 其它

ionic开发常见问题及解决方案(四)

2017-03-24 14:38 253 查看
http://blog.csdn.net/CapMiachael/article/details/54344100

1. 退出后重新登录,默认方法不执行,没有重新获取数据。 

原因:$ionicHistory中的数据未清理,留有缓存 

解决方法: 退出或是重新登录时进行历史缓存清理
$ionicHistory.clearCache()
1
1
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') })
1
2
3
4
5
6
7
1
2
3
4
5
6
7

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: