So, I have these 2 arrays of objects. I want to use ng-repeat so that it prints elements from countOfServicesCodesByElements with the same index as the date. Therefore, to start the date: "09.09.2016", end: "13. 09. 2016", it should print 23, etc.
$scope.countOfServicesCodesParts = [ {
start: "09. 09. 2016",
end: "13. 09. 2016"
},
{
start: "15. 09. 2016",
end: "18. 09. 2016"
},
{
start: "27. 09. 2016",
end: "30. 09. 2016"
}
]
$scope.countOfServicesCodesByElements = [{
"count": 23
},
{
"count": 30
},
{
"count": 20
},
{
"count": 2
}
]
this is my html file
<div class="card-content" ng-if="countOfServicesCodesEval != 0" ng-repeat="date in countOfServicesCodesParts" >
<table class="table table-striped">
<tr >
<span span ng-if="countOfServicesCodes != 0" style="font-weight:bold">
date start {{date.start}} date end: {{date.end}}
</span>
</tr>
<div >
<tr >
<td class="col-md-2"><span ng-if="countOfServicesCodes != 0" > number:</span></td>
<td class="col-md-2"><text class="text-info">{{countOfServicesCodesByElements.count}}</text></td>
</tr>
</div>
</table>
</div>
source
share