I am new to AngularJS. I have a problem with using ng-repeat. I have two objects and i want to iterate like:
first tr with obj1 next tr with obj2 next tr with obj2 next tr with obj2
next tr with obj1 next tr with obj2 next tr with obj2 next tr with obj2
next tr with obj1 next tr with obj2 next tr with obj2 next tr with obj2
when i use
<tr ng-repeat ="obj in obj1"></tr>
after one iteration I want to repeate on obj 2 so that one tr will be of obj1 and another with obj2.
$scope.OBJ1=[
{"primaryKey":1,"value":"something1"},
{"primaryKey":2,"value":"something2"},
{"primaryKey":3,"value":"something3"},
{"primaryKey":4,"value":"something4"}
];
$scope.OBJ2=[
{"primaryKey":1,"dayPart":"dinner"},
{"primaryKey":1,"dayPart":"lunch"}
];
and expected result :
<tr>something1</tr>
<tr>dinner</tr>
<tr>lunch</tr>
<tr>something2</tr>
<tr>dinner</tr>
<tr>lunch</tr>
<tr>something3</tr>
<tr>dinner</tr>
<tr>lunch</tr>
<tr>something4</tr>
<tr>dinner</tr>
<tr>lunch</tr>
Thanks!!