I have the following function in my controller...
$scope.pagerPages = function (n) {
var i = Math.ceil(n);
return new Array(i);
}
the n
comes from an expression on the view, and can sometimes be a fraction. Which is why I've done Math.ceil
on n
.
Anyone know why I would be getting this error?
Invalid array length
EDIT;
n
is a calculation from the view
<div ng-repeat="i in pagerPages( report.TotalNumRows / report.View.PageSize ) track by $index">
...
</div>
the calculation results in 11.2, which is evidentally working, as on the page i get 12 iterations of the div element, yet it's generating this error?