Answer the question
In order to leave comments, you need to log in
How to sort only even items in an array using ng-repeat?
Hello,
there is a json that is parsed from api.
"dishes": [
{
"name": "apple salat",
"calories": 100,
"proteins": 30,
"carbohydrates": 25,
"fats": 30,
"food_items": [
{
"name": "apple",
"calories": 100,
"proteins": 30,
"carbohydrates": 25,
"fats": 30
},
1,
{
"name": "fruit salat",
"calories": 100,
"proteins": 30,
"carbohydrates": 25,
"fats": 30,
"food_items": [
{
"name": "apple",
"calories": 100,
"proteins": 30,
"carbohydrates": 25,
"fats": 30
},
2
]
<li ng-repeat=" food_items in data.dishes track by $index">{{ $even.name }}</li>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question