解决ionic切换路由后,不继承tab路由,没有返回按钮问题

参考网站:http://bbs.phonegap100.com/thread-3962-1-1.html

 

.state('tab.user', {
    url: '/user',
    views: {
        'tab-user': {
            templateUrl: 'templates/user/user.html'
}
    }
})


.state('login', {
    url: '/login',
    templateUrl: 'templates/user/login.html',
    controller:'Login'
})

解决方法

.controller('Login',function($scope){


        $scope.$on('$ionicView.beforeEnter', function (event, viewData) {
            viewData.enableBack = true;
        });
})

 

posted @ 2017-06-28 14:00  宝宝&贝贝  阅读(928)  评论(0编辑  收藏  举报