如何在 html 属性中使用 Angular 指令

How to use Angular directive in html attribute

我有一个 translationDirective 来翻译我模板中的文本。

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

是否也可以在 html 属性中使用翻译后的值?

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

管道用于修改数据。指令用于更新 DOM.Can 你请 post 你的代码。