我有一个要注入的角度组件模板title
,@Input()
显示为:
<div class="title" >
{{ title }}
</div>
如何title
使用 ng2-translate 的管道将翻译后的内容注入到父组件中,如下所示:
<title-component
[title]="{{ 'KEY' | translate }}"
></title-component>
我想将翻译后的字符串动态传递给子组件,但我更愿意避免将翻译服务注入到组件的构造函数中,并尽可能将所有内容保留在模板中。谢谢