This feels like a fairly basic feature in a templating engine, but I seem to be missing it somehow.
Assume a template like this:
<a ng-if="icon.link" href="icon.link">
<i ng-class="['fa',icon.icon_class]"></i>
</a>
<span ng-if="!icon.link">
<i ng-class="['fa',icon.icon_class]"></i>
</span>
This will accomplish what I want, but the downside is that it requires duplicating all the child elements whenever I want to conditionally use a different parent element.
Is there any way to do something like:
<span ng-if-include-children="!icon.link">
<a ng-if-include-children="icon.link" href="icon.link">
<i ng-class="['fa',icon.icon_class]"></i>
</a>
</span>
Essentially I am just trying to figure out the best way to swap out a container element while not duplicating all of its contents.