In a project with tabs, when entering the sub-level, the bottom navigation still exists. I want to let him exist only on a few interfaces on the homepage and hide others. Here, the angularjs command is used. The step to complete is divided into three steps:
Add: ng-class=”{'tabs-item-hide': $}" in the tag ion-tabs, the source code is as follows
<ion-tabs class="tabs-icon-top" ng-class="{'tabs-item-hide': $}"> //tabs </ion-tabs>
Add angularjs directive, the source code is as follows:
//The app has been specified in other files, such as var app = ("starter",["ionic"])('hideTabs', function($rootScope) { return { restrict: 'A', link: function(scope, element, attributes) { scope.$on('$', function() { scope.$watch(, function(value){ $ = 'tabs-item-hide'; }); }); scope.$on('$', function() { scope.$watch(, function(value){ $ = 'tabs-item-hide'; }); scope.$watch('$destroy',function(){ $ = false; }) }); } }; });
Add the expression hide-tabs=”true” to the interface tag ion-view you want to hide, the source code is as follows:
//This is the file in the official website template<ion-view hide-tabs="true" view-title="{{}}"> <ion-content class="padding"> <img ng-src="{{}}" style="width: 64px; height: 64px"> <p> {{}} </p> </ion-content> </ion-view>
The above is the perfect solution for ionic to hide the bottom navigation bar (tabs) after entering the multi-level directory. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!