Following is the working code - http://plnkr.co/edit/6lRhiTd1BrKRdThY0WNB?p=preview
In this if you select the number from drop down and fill data then click and check console you will see the result like -
[
Object { start_time="12Start", end_time="12END"},
Object { start_time="34start", end_time="786"},
Object { start_time="123", end_time="5656"},
Object { start_time="098", end_time="77"},
Object { start_time="75757", end_time="57567"}
]
Now If you check, there are two arrays - $scope.shiftstart | $scope.shiftend
I am looping through these but one problem with this approach is that-
1) It needs to be dependent on the equal length of arrays.
2) If some one leaves the first end time input field then it comes as undefined in the console.
What I am thinking is to not to use - separate ng-model="shiftstart[shiftnumber]" & ng-model="shiftend[shiftnumber]" instead I could use ONE single array containing multiple objects but I am unable to integrate the solution, let me know what I can amend in my code to make that happen.
ng-model="shiftstart[shiftnumber]"&ng-model="shiftend[shiftnumber]"to be used as a single entity likeng-model="shift.start_time[shiftnumber]"&ng-model="shift.end_time[shiftnumber]"so that it will produce the same array of object result