What is the easiest(and correct) way to have dynamic templates for directive and keep replace option (want to have all the attributes on my template).
I'm trying to create "link" directive that will be extension for ui-router/ui-sref : when the state is current state - we show just a text (not a link).
It's not a problem to do just dynamic templates via compile(or $compile service), but how could I keep replace option on, that passes all the directive attributes to the template.
So I would like to have
<ui-link ui-sref="dashboard.common" class="nav-alt__item">Dashboard</ui-link>
Like
<a ui-sref="dashboard.common" class="nav-alt__item">Dashboard</a>
in one case and
<span ui-sref="dashboard.common" class="nav-alt__item">Dashboard</span>
in another.
actually I don't need ui-sref for span, but it's not a big issue.
May be there is already existing extension solutions for ui-router.