search

Home  >  Q&A  >  body text

angular.js - How to hide tabs in ionic three-level directories or even multi-level directories?

.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;
                })

            });
        }
    };
})

Currently, this command is used to hide the headphone directory

过去多啦不再A梦过去多啦不再A梦2809 days ago698

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-05-15 16:59:31

    http://www.ithao123.cn/content-7470620.html

    This is more powerful, there is no need to monitor the beforeEnter and beforeLeave events of each page

    reply
    0
  • Cancelreply