On my page, there is an array containing nested arrays that are being displayed using ng-repeat twice.
<div ng-repeat="chapter in chapters">
<div ng-repeat="page in chapter.pages">
<p>Title: {{page.title}}</p>
</div>
</div>
The array looks like this:
$scope.chapters= [
{
pages: [
{title: 'Title3'},
{title: 'Title4'},
{title: 'Title5'}
]
},
{
pages: [
{title: 'Title1'},
{title: 'Title2'}
]
}
];
I want to be able to access the $index of each chapter and page within the 'p' element. How can I achieve this?