ionic Hide tabs 实现

1.指令代码

复制代码
 1 directiveMod.directive('hideTabs',function($rootScope){
 2     return {
 3         restrict:'AE',
 4         link:function($scope){
 5             $scope.$on('$ionicView.beforeEnter', function() {
 6                 $rootScope.hideTabs = 'tabs-item-hide';
 7 
 8                 console.log('tabs-item-hide');
 9 
10             });
11             $scope.$on('$destroy',function(){
12                 $rootScope.hideTabs = '';
13                 console.log('no-tabs-item-hide');
14 
15             })
16         }
17   } })
复制代码

2.使用示例:

 app.js

 angular.module('starter', ['ionic','starter.controllers','starter.directive'])

 tabs.html

 

1 <ion-tabs class="tabs-icon-top tabs-color-active-positive {{hideTabs}}">
2 </ion-tabs>
1 <ion-view hide-tabs title="详情">
2 ......
3 </ion-view>

 

posted @   sulin  阅读(351)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示