我有一个看起来像这样的json,我正在Angular的数据库中读取:
{"content":"{
"address": "<p>This is a test</p>",
"email": "<p><a href='mailto:info@info.com'>info@info.com</a></p>",
"country": "UK"
}"}
此数据通过以下方式接收:
var urlData = $resource('http://info.com/admin/get_page/2');
$scope.Data = urlData.get();
在我看来,我需要打印地址和另一封电子邮件,所以我想它应该是这样的:
<article class="contactInfo-group" ng-bind-html="Data.content">
{{ Data.content.address }}
</article>
我怎样才能得到我想要的信息?
答案 0 :(得分:1)
<article class="contactInfo-group">
{{ Data.content.address }}
</article>}}
json应该是:
$scope.data = {"content":
{
"address": "<p>This is a test</p>",
"email": "<p><a href='mailto:info@info.com'>info@info.com</a></p>",
"country": "UK"
}
}