codelearner codelearner - 1 year ago 40
JSON Question

How to write two ng-repeat by mixing the values?

i have 2 json ,


i have to display first start_date and first end_date , second start_date and second end_date using ng-repeat.Is it possible to display like this using ng-repeat using anguarjs. can anyone please help me

Answer Source

I think you're looking for something like below. There are a few ways to do it. ng-repeat exposes $index which you can use to display an item in the other array, assuming both arrays have the same number of items.

  <li ng-repeat="date in start_date">Start: {{date}}, End: {{end_date[$index]}}</li>

And you should make those arrays: