Created
May 3, 2017 21:08
-
-
Save fouad-j/7de21e198e48f1f91b2988791a40e0ce to your computer and use it in GitHub Desktop.
example_angular_toggle_directive_es6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app').directive('featureToggle', function(toggleService) { | |
return { | |
restrict: 'A', | |
template: '<span ng-transclude></span>', | |
transclude: true, | |
link: function(scope, element, attrs) { | |
if(toggleService.isEnable(attrs.featureToggle)) element.remove() | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment