I am encountering an issue with the function in my controller...
$scope.pagerPages = function (n) {
var i = Math.ceil(n);
return new Array(i);
}
The n
value is derived from an expression on the view and can sometimes be a fraction. This is why I have used Math.ceil
on n
.
Does anyone have insight into why this error is occurring?
Invalid array length
EDIT:
n
is calculated 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 seems to be functioning correctly since I get 12 iterations of the div element on the page. Yet, the error persists. Any suggestions?