0

次のようなjsonプロパティファイルでdata-18nを問題なく使用できます。

<div data-i18n="errIncorrectSpecies"></div>

json プロパティ ファイルには次のエントリがあります。

"errIncorrectSpecies":"You have selected incorrect species tests."

動的パラメーターを「errIncorrectSpecies」値に入れるにはどうすればよいですか? 私はjsonファイルでこれをしたいと思います:

"errIncorrectSpecies":"You have selected {0} tests for this {1}."

"{0}" と "{1}" を渡す方法がわかりません...

4

1 に答える 1

0

私のhtmlファイルでこのようにできるように見えます...

<div>{{i18n('errIncorrectSpecies', {'0':'test','1':'test2'})}}</div>

HTML ではなく、angular ディレクティブでプログラムでこれを実行できるかどうかを確認します。

于 2013-10-11T19:09:24.490 に答える