我有一个带有翻译的JSON文件。我特别有一个名为Select_Time_Format的属性。我想在HTML字段的占位符属性中使用此翻译(如下所示)
<label for="time-format" i18ng="'Time_Format'"></label>
<div class="select2-container select x100" id="s2id4">
<select ngyn-select2
ng-model="$ctrl.tournament.time_format"
ng-options="key as label for (key, label) in $ctrl.timeFormats"
id="time-format"
name="time_format"
class="select x100"
placeholder="Select Time Format">
</select>有没有什么方法可以用像i18ng="'Select_Time_Format'"这样的东西来代替placeholder="Select Time Format
发布于 2017-08-10 00:16:59
正确的语法如下所示。
placeholder="{{ 'Whatever_Your_Translation_Name_Is' | t }}"
https://stackoverflow.com/questions/45595360
复制相似问题