I would like to dynamically set <input type='text' placeholder=' {{ 'somestring' | getText }}'>
placeholders using pipes. (this method does not work)
The pipe itself works perfectly fine e.g.
<p>{{ myVariable | getText}}</p>
will correctly render, as well as <p>{{ 'someString' | getText}}</p>
How does one use this to dynamically set placeholder strings?
You can either use Matthias's suggestion or use double quotes for attribute/property/binding values. As a matter of fact, -always- use double quotes!
<input type="text" placeholder="{{ 'somestring' | getText }}">
or
<input type="text" [placeholder]="'somestring' | getText">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With