gpt4 book ai didi

javascript - ng-repeat 不适用于我的数据

转载 作者:行者123 更新时间:2023-11-29 14:52:36 25 4
gpt4 key购买 nike

在我的 index.html 中我试过了

<li ng-repeat="friend in user.relationship">{{friend.name}}</li>

这是我的 json 样子

var user = [
{
'uId': 1,
'name': 'me',
'relationship':
[
{'uId':2,
'name': 'Jeremy',
'tabs':[{'tabId':1}],
'tasks':[{'name':'Im Jeremy Lin'}]
}
]
}
]

我什至试过<li ng-repeat="friend in user[0].relationship">{{friend[0].name}}</li>

最佳答案

应该是

<li ng-repeat="friend in user[0].relationship">{{friend.name}}</li>

关于javascript - ng-repeat 不适用于我的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23075006/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com