I'm using angular to fetch data from a web service, the data is in JSON format :
{
"items": [{
"id": 2,
"catId": 1,
"content": "ddddddddddddddddd",
"type": 0,
"comments": [{
"id": 0,
"postId": 0,
"userId": 0,
"content": "nincompoop",
"ptime": "2015"
}, {
"id": 0,
"postId": 0,
"userId": 0,
"content": "lol",
"ptime": "2015"
}],
"Likes": []
}, {
"id": -1,
"catId": 1,
"content": "first post",
"type": 0,
"comments": [{
"id": 1,
"postId": 0,
"userId": 0,
"content": "first Comment",
"ptime": "2015"
}],
"Likes": [{
"id": 1,
"name": "Rawhi"
}]
}]
}
Also the user ID is stored in a javascript parameter, How can I iterate over the 'item.likes' for each post and determine if the user Id is existing ? thank you
javascriptfor it or you want to use intemplateuseng-Repeat