Although I am new to Angular, I have been struggling with a problem for the past few days and can't seem to find a solution.
I want to create a matrix of images (charts generated by angular-chart module) with 2 columns that will dynamically load a variable number of images. My aim is to achieve something like this:
image
After some attempts, I came up with the following code snippet:
<div ng-repeat="item in items">
<div class="row">
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">{{ item.name }}</h3>
</div>
<div class="panel-body">
{{ item.data }}
</div>
</div>
</div>
<div class="col-lg-6" ng-init="$index = $index + 1">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">{{ item.name }}</h3>
</div>
<div class="panel-body">
{{ item.data }}
</div>
</div>
</div>
</div>
</div>
However, I encountered an issue where modifying the value of the $index variable within ng-repeat seemed impossible. How can I overcome this obstacle and successfully build a dynamic matrix of images based on data stored in an array of objects?