Ionic after entering the multilevel directory hide bottom navigation bar (tabs) solution

Source: Internet
Author: User

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>





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.