【发布时间】:2015-09-25 06:44:38
【问题描述】:
我在 html 中显示 JSON 元素时遇到问题
这是 JSON
peopleList: [
{
name: 'John',
address: 'Street A, 143',
sons: [{
First: "Jack",
Second: "Jane",
Third: "Maria"
}]
}]
这里是html
<div ng-repeat="people in peopleList">
<span class="">name: {{people.name}}</span><br>
<span class="">sons: {{people.sons}}</span>
</div>
这个节目儿子:[{“First”:“Jack”,“Second”:“Jane”,“Third”:“Maria”,“_id”:“5604e8e474758451s6d813”}]
我试过用
people.sons.First
但没有显示任何内容
【问题讨论】:
-
试试这个:
{{people[0].sons[0].First}} -
ng-repeat="name in names"和人员是什么?或者,它们是否依赖?
标签: javascript json angularjs