Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fouad-j/7de21e198e48f1f91b2988791a40e0ce to your computer and use it in GitHub Desktop.
Save fouad-j/7de21e198e48f1f91b2988791a40e0ce to your computer and use it in GitHub Desktop.
example_angular_toggle_directive_es6
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