问题Angular Json阿拉伯数据 [英] Problem Angular Json arabic data
本文介绍了问题Angular Json阿拉伯数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨兄弟
i当我尝试用阿拉伯语检索数据时,json数据文件有问题
hi brothers
i have problem with json data file when i'm trying retrieve data with arabic language
From: "��"
NameAR: "����� ����"
NameEN: "����� �������"
Tax: "�����"
To: "���"
这是json文件
{
NameEN:الأسمانجليزي,
NameAR:الأسمعربي,
From: من,
To:الي,
税:ضريبة
}
this is json file
{
"NameEN" : "الأسم انجليزي",
"NameAR" : "الأسم عربي",
"From" : "من",
"To" : "الي",
"Tax" : "ضريبة"
}
<pre lang="Javascript">
app.service('translationService', ['$resource', '$cookies', function ($resource, $cookies) {
var language = $cookies.Cookie_Language;
this.Translation = function ($scope) {
var translatorPath = '/Translations/Translator/Translation_' + language + '.json';
$resource(translatorPath, {
contentType: "application/json; charset=utf-8", dataType: "json",
}).get(function (data) {
alert(data.NameEN);
$scope.translation = angular.fromJson(data);
});
};
}]);
</pre>
<
这是问题
< img src =http://www.gulfup.com/?ZQKmIx/>
this is problem
<img src="http://www.gulfup.com/?ZQKmIx" />
推荐答案
resource','
resource', '
cookies',function(
cookies', function (
resource,
这篇关于问题Angular Json阿拉伯数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文