Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-repeat doesn't work with data in my case

in my index.html I tried

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

and this is my json look like

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

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

like image 223
noob Avatar asked Apr 13 '26 18:04

noob


1 Answers

It should be

<li ng-repeat="friend in user[0].relationship">{{friend.name}}</li>
like image 188
xdazz Avatar answered Apr 15 '26 08:04

xdazz