Ionic development of page jump hidden ion-tabs__ionic

Source: Internet
Author: User

Scenario Description:


Click Test Device 1 to jump to the device Details page, hide the bottom title bar Ion-tabs on the device Details page, and display the bottom title bar when the page is returned from the device Details page to the home page.

Specific steps:

1. Add after Ion-tabs

ng-class="{' tabs-item-hide '$root. Hidetabs }"

2. Add in App.js

. directive (' ShowTabs '($rootScope) {
  {
    restrict' A ',
     ($scope, $el) {
      $rootScope.  false;}}
)
. Directive (' Hidetabs '($rootScope) {
  
    restrict' A ' 
    ,($scope, $el) {
      $rootScope.  true;
    }
  ;
})
3. Hide, add after Ion-view in the device details page
Hide-tabs

4. Display, adding in the controller of the home page

$scope. $on (' $ionicView. Enter '() {
    //display tabs
    $rootScope.  false;
})

Note: To add $rootscope after the function here, the code follows

. Controller (' HomeController ',function($scope, $rootScope) {
    $scope.  Title=' home '

    $scope.  = [];
     for (i=0;i<10;i++)
        $scope. items. push ([test device, I+1].join (")")


    $scope. $on (' $ionicView. Enter ' () {//Show tabs $rootScope. 
         false;
    })
}
This realizes the function in the above scenario description.

As just beginning to contact Ionic development, a lot of things are not very understand, said some ink, forgive ...

Reference URL: http://www.cnblogs.com/maoyazhi/p/4424039.html





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.