In my application, the user is prompted to select a language based on which all content in the application will be changed to this specific language. I use json array to get user information, so I saved it as
{"uniqueId":1238902,
{
"english":{
"username":"Sherif",
"phone" :(234)567-0988
},
"arabic":{
"name":"شريف",
"phone": (234)567-0988}}
But Im only able to display one language in my html,
{{"User Name" |translate}}:
<input type="text" ng-model="editingInfo[0].arabic.name">
<br>
{{"Phone"translate}}:
<input type="number" ng-model="editingInfo[0].arabic.phone">
<br>
<button ng-click="save()">
controller:
$scope.editing=function(key){
$scope.editingInfo=[];
for (var i=0; i<$scope.userInfo.length;i++)
{
if($scope.userInfo[i].uniqueId == key.uniqueId){
$scope.editingInfo.push($scope.userInfo[i]);
};
};
So, how will I use both languages on the same html page. What error do I make when calling data in html.
source
share