AngularJS ng-repeat grid of two divs per line
I want to load data from an array and display two divs per line.
For example: there are 8 objects. I want them to be displayed on four lines of two
12
3 4
5 6
7 8
code:
<div ng-repeat="accObj in accountsArr" width="100%">
<div class="col" width="100%">
<div ng-if="$even" style="width:50%;height:70px;background-color:red">
{{accObj.account}}<br>
{{accObj.type}}
</div>
<div ng-if="$odd" style="width:50%;height:70px;background-color:yellow">
{{accObj.account}}<br>
{{accObj.type}}
</div>
</div>
</div>
This is how my code works at the moment. Plnkr
Can anyone advise me how to get the desired result?
Any help is appreciated.
+3
source to share