praveenpds praveenpds - 1 year ago 159
AngularJS Question

how to translate the html5 placeholders dynamically

I'm using angular-translate to translate the page content in to different languages.

<input type ='text' placeholder = ' {username | translate}'>

This works fine when the page loads ..but it fails to translate when I use
depending upon language dropdown changes.

Can any one kindly suggests the solution to translate the placeholders while the language changes dynamically ?

Answer Source

Did you try:

<input type="text" placeholder="{{ 'my.i18n.key' | translate }}" ng-model="myModel">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download