Search code examples
angularangular-directive

How to use Angular directive in html attribute


I have a translationDirective to translate a text in my template.

<span translate="{{label}}">{{label}}</span>

Is it possible to use the translated value also in a html attribute?

<span translate="{{label}}" someOtherAttribute="translatedLabel">{{label}}</span>

Solution

  • Pipes are used to modify data . And directives are used to update DOM.Can you please post your code.