AngularJS track by index but from nested object in json
I've got json object "$scope.dayMonth" like this:
[
{
"month": 1,
"maxDay": 31
},
{
"month": 2,
"maxDay": 28
},
{
"month": 3,
"maxDay": 31
},
etc...
]
So I want to show 31 rows depending on month day limit.
I tried something like this:
<tr>
<th class="text-center nowrap" ng-repeat="item in dayMonth track by $index">
{{item.maxDay}}
</th>
</tr>
I wanted efect of this:
<th class="text-center nowrap" ng-repeat="days in dayMonth track by $index">
{{$index+1}}
</th>
But not for number of months - for number of maxDay.
I hope you will understand my thinking :P