- 当一个页面有多个tab的时候,从详情页面返回到主页,路由不能使用cache: true时,但是你又需要返回主页面刷新页面消息的时候,就可以使用下面的方法:
// 界面缓存清理
$ionicHistory.clearCache().then(function () {
$state.go('tabs.headlines', { module: "ORDER" });
});
- ionic 生命周期
进入页面是调用
$scope.$on('$ionicView.enter', function(){
//调用初始化的函数
$scope.onPullDown();
});
- 路由改变
路由发生改变的时候调用
$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {
console.log("路由发生改变");
});
- ionic2 返回上一页 刷新列表
Events 有三个方法 分别是:
this.events.publish () //注册Events事件
this.events.subscribe() //调用Eevents事件
this.events.unsubscribe() //注销Events事件
列表页面
//返回上一页 页面刷新
this.events.subscribe("reloadBQHPage", () => { 调用Eevents事件
this