Short question
Can I have an input element where the placeholder text changes depending on the state of the component?
Longer question
Angular has the possibility to add i18n through the following syntax example:
<input i18n-placeholder placeholder="default placeholder" />
It also has the possibility to add pluralization rules through the following syntax example:
<span i18n>
Updated {minutes, plural, =0 {just now} =1 {one minute ago} other {{{minutes}} minutes ago}}
</span>
I've tried to merge these two features, so that the text of the placeholder changes depending on the state of the component. The component template contains the following html:
<input i18n-placeholder placeholder="Add {stuff.length, plural, =0 {} other {more}} stuff..." />
I expect the placeholder to say Add stuff...
in the singular case, and Add more stuff...
in the plural case, but all I get in the placeholder is Add
.
Is there a way to get pluralized i18n in html attributes without copying the element and using *ngIf
?