首页 > 其他 > 详细

ionic隐藏tabs方法

时间:2015-04-14 09:50:13      阅读:725      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!