ionic隐藏tabs方法

1.

 ng-class="{'tabs-item-hide': $root.hideTabs}">

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

 title="New Entry Form" hide-tabs> 

你可能感兴趣的:(angularJS,add,ionic)