1

I want to hide the Directive name markup from my html

Right now I am doing this

<option-found-address-display></option-found-address-display>

But when this renders/compiles I just want to show the contents of the directive. Not the actual <option-found-address-display>and then my content within.

I am pretty sure I saw a way how to hide this but can't remember

StevieB
  • 6,263
  • 38
  • 108
  • 193

1 Answers1

2
app.directive('optionFoundAddressDisplay', function() {
  return {
    restrict: 'E',
    template: '<div>your content</div>',
    replace:true
  }
});

will hide the directive name markup from the html.

Replace:true does the trick.

For more about replace:true

Community
  • 1
  • 1
Manube
  • 5,110
  • 3
  • 35
  • 59