I'm trying to develop some pagination buttons using ng-repeat like this:
<li ng-repeat="(indexN, item) in objsCh[indexO].nit | limitTo: (Math.ceil(indexN+1/10))"><a href="#">{{(Math.ceil(indexN+1/10))}}</a></li>
This code checks how many items there is in an array, divide it by 10 and create an tag with the Match.ceil result on it.
Unfortunaly, this not work properly.
PS.: in my controller I put this piece of code:
$scope.Math = window.Math;
Someone have any idea how to solve it using the code this way?
Thanks!
Ok, I found the solution. I am not sure if it's the best but it solved my problem.
The fixed code:
I set the limitTo using the length of the array instead of index and I return the index inside each button.