Base solution for your next web application
Open Closed

Localization not working on HTML input placeholder property #3012


User avatar
0
Ricavir created

Hi,

I wanted to use the localization method inside my HTML template within an input object (angular2 project) . But, writing into placeholder property is not working : placeholder={{l("SomeID")}}

Any reason for that ?


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    the "l" method is defined in AppComponentBase. Do you extend AppComponentBase in your component ?

  • User Avatar
    0
    Ricavir created

    Yes for sure, I'm extending AppComponentBase.

    By digging on this issue this afternoon I found the problem : I used simple quotes instead of double. Now it's working.

    This code doesn't work : <input class="form-control" type="text" name="DoorCode" <span style="color:#FF0000">placeholder="{{l("DoorCode")}}" </span>[(ngModel)]="address.doorCode" >

    This one works well : <input class="form-control" type="text" name="DoorCode" <span style="color:#0040FF">placeholder='{{l("DoorCode")}}' </span>[(ngModel)]="address.doorCode" >

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks for the feedback. I couldn't notice that one :), your fix is good.