隐藏tab 指令 hideTabs.js

angular.module('app.directives', [])
.directive('hideTabs', function ($rootScope) {
    return {
        restrict: 'A',
        link: function (scope, element, attributes) {
            scope.$watch(attributes.hideTabs, function (value) {
                $rootScope.hideTabs = value;
            });
 
            scope.$on('$destroy', function () {
                $rootScope.hideTabs = false;
            });
        }
    };
});
posted @ 2016-07-01 16:28  灬東歌℡  阅读(371)  评论(0)    收藏  举报