Javascript 使用AngularJS在我的视图中的另一个json中呈现json
我有一个json,看起来像这样,我正在从我的数据库中读取:Javascript 使用AngularJS在我的视图中的另一个json中呈现json,javascript,json,angularjs,Javascript,Json,Angularjs,我有一个json,看起来像这样,我正在从我的数据库中读取: {"content":"{ "address": "<p>This is a test</p>", "email": "<p><a href='mailto:info@info.com'>info@info.com</a></p>", "country": "UK" }"} 在我看来,有一个地方我只需要打印地址和另一封电子邮件,所以我想
{"content":"{
"address": "<p>This is a test</p>",
"email": "<p><a href='mailto:info@info.com'>info@info.com</a></p>",
"country": "UK"
}"}
在我看来,有一个地方我只需要打印地址和另一封电子邮件,所以我想应该是这样的:
<article class="contactInfo-group" ng-bind-html="Data.content">
{{ Data.content.address }}
</article>
{{Data.content.address}
我怎样才能在那里得到我想要的信息?“,
<article class="contactInfo-group">
{{ Data.content.address }}
</article>}}
“国家”:“英国”
}
}
看小提琴。
问题在于urlData.get()在数据中为我保存了一个“资源”,而不是像您的案例中那样的“对象”,并且在使用Data.content.addressNevermind时它不会打印任何内容,我做得不错,但后端提供了错误的JSON--
<article class="contactInfo-group">
{{ Data.content.address }}
</article>}}
$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"
}
}