码迷,mamicode.com
首页 > 其他好文 > 详细

ionic隐藏tabs方法

时间:2015-04-14 09:51:50      阅读:430      评论:0      收藏:0      [点我收藏+]

标签:

1.

<ion-tabs ng-class="{‘tabs-item-hide‘: $root.hideTabs}" class="tabs-icon-only">

<!-- tabs -->

</ion-tabs>

2.

在该控制器下加上.directive:

var module = angular.module(‘app.directives‘, []);
module.directive(‘hideTabs‘, function($rootScope) {
    return {
        restrict: ‘A‘,
        link: function(scope, element, attributes) {
            scope.$watch(attributes.hideTabs, function(value){
                $rootScope.hideTabs = value;
            });

            scope.$on(‘$destroy‘, function() {
                $rootScope.hideTabs = false;
            });
        }
    };
});

3.

在html页面中引用hide-tabs

<ion-view title="New Entry Form" hide-tabs>
    <!-- view content -->
</ion-tabs>

 

ionic隐藏tabs方法

标签:

原文地址:http://www.cnblogs.com/maoyazhi/p/4424039.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!