In the tabs project, when entering the sub-level, the bottom navigation has always existed, I was to let him only in the first few interfaces exist, the other hidden, here to use the ANGULARJS instructions, to complete this step is divided into three steps:
Add in label Ion-tabs: ng-class= "{' Tabs-item-hide ': $root. Hidetabs}", the source code is as follows
<ion-tabs class= "Tabs-icon-top" ng-class= "{' Tabs-item-hide ': $root. hidetabs}" >
//tabs
</ion-tabs >
Add Angularjs instructions, the source code is as follows:
The app has been specified in other files, such as var app = Angular.module ("starter", ["Ionic"])
app.directive (' Hidetabs ', function ($rootScope) {
return {
restrict: ' A ',
link:function (scope, element, attributes) {
scope. $on (' $ Ionicview.beforeenter ', function () {
scope. $watch (Attributes.hidetabs, function (value) {
$ Rootscope.hidetabs = ' tabs-item-hide ';
}
); Scope. $on (' $ionicView. Beforeleave ', function () {
scope. $watch (Attributes.hidetabs, function (value) {
$ Rootscope.hidetabs = ' tabs-item-hide ';
});
Scope. $watch (' $destroy ', function () {
$rootScope. Hidetabs = false;})});};})
;
In the Interface tab you want to hide Ion-view add an expression hide-tabs= "true", the source code is as follows:
This is the file in the official website template
<ion-view hide-tabs= "true" view-title= "{{chat.name}}" >
<ion-content class= "padding" >
<p>
{{Chat.lasttext}}
</p>
</ion-content>
</ion-view>