I am trying to create an angular directive with a template, but I also don\'t want to lose the HTML inside of the div. For example, here is how I would like to call my directiv
You'll need to use ng-transclude, add transclude: true
in your directive options, and add ng-transclude
to your template:
<div class="example" style="…" ng-transclude></div>`
This plunkr has an example on how to use ng-transclude with a template, to keep the original dom element.
http://plnkr.co/edit/efyAiTmcKjnhRZMTlNGf