I have a angular controller that defines an array of elements as follows:
$scope.tasks = [{val=1},{val=2},{val=3},{val=4},{val=5},{val=6},{val=7},{val=8},{val=9},{val=10}];
I want to generate a series of elements for this and I can do this as follows:
<div ng-repeat-"button in tasks">
<button id = {{ $index}} value='{{task.val}}'></button>
</div>
However, I want the buttons to appear in two rows - like 1-5 in first row and 6-10 in the 2nd row. I think I have to use $index for this, but now sure how to do it.
Can someone help?