[英]How to dynamic translate text file using parameter to the ngx-translate in angular?
[英]How to translate data to ts using ngx translate to angular
组件.ts
我在 app.component.ts 中有这段代码,需要将其转换为 select 选项
label = ['', 'label1', 'label2']
组件.html
html 使用 ng For
<select>
<option *ngFor="let value of label">{{value}}</option>
</select>
使用pipe在模板中翻译它。
<select>
<option *ngFor="let value of label">{{value | translate}}</option>
</select>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.