2016-09-06 16 views
-1

AngularJSで開発されたclip-twoを使用していますが、これはすべてのHTMLタグで動作するJSONファイルを使用して多言語の翻訳を使用していますが、これを使用してプレースホルダー働いていない。AngularJS translateがプレースホルダーで機能しない

JSON形式

"addemployee": { 
    "Name": "Name", 
    "Typename": "Type name", 
    "Employeid": "Employe id", 
    "Username": "Username", 
    "Contactno": "Contact no.", 
    "Typecontactno": "Type contact no.", 
    "Password": "Password", 
    "Typepassword":"Type password", 
    "Confirmpassword": "Confirm password", 
    "Selectimagefile": "Select an image file", 
    "remove": "Remove", 
    "cancel": "Cancel", 
    "upload": "Upload", 
    "Addemployee": "Add employee", 
    "TypeConfirmpassword": "Type Confirm password" 
} 

HTMLタグ

<h1 class="mainTitle" translate="addemployee.Addemployee"> Add Employee</h1> 

のために動作しますが、入力プレースホルダあなたはちょうどこのようにしてみてくださいでした

placeholder="" 
+0

ええ、 'placeholder =" "'は何でもするつもりはありません – Phil

答えて

0

で動作しないしないのですか?

<input type="text" placeholder="{{ 'addemployee.Addemployee' | translate }}" ng-model="myModel"> 

編集:

<input type="text" ng-attr-placeholder="{{ 'addemployee.Addemployee' | translate }}" name="firstName" ng-model="employee.name" id="name" class="form-control" required> 

"addemployee": { 
    "Name": "Name", 
    "Typename": "Type name", 
    "Employeid": "Employe id", 
    "Username": "Username", 
    "Contactno": "Contact no.", 
    "Typecontactno": "Type contact no.", 
    "Password": "Password", 
    "Typepassword":"Type password", 
    "Confirmpassword": "Confirm password", 
    "Selectimagefile": "Select an image file", 
    "remove": "Remove", 
    "cancel": "Cancel", 
    "upload": "Upload", 
    "Addemployee": "Add employee", 
    "TypeConfirmpassword": "Type Confirm password" 
} 

あなただけng-showまたはng-hideのような2つの変換のための条件を使用する必要があります。

+0

はい私はそれがうまくいっていません –

+0

これはあなたの問題を確実に解決します。 https://github.com/angular-translate/angular-translate/issues/874 – Noman

+0

英語とヘブライ語で翻訳しています –

関連する問題