I got this quite simple
<table>
<tr>
<td ng-repeat="c in schedIdTableCtrl.calculateNumberOfColumns() track by $index">{{schedIdTableCtrl.calculateTime($index)}}</td>
</tr>
</table>
And it returns an array with 504 elements.
But when I console.log()
it says
(2) 504
(2) 504
504
So instead of running only once, it is running five times?
My javascript for this is simply
ctrl.calculateNumberOfColumns = () => {
let columns = length / interval;
console.log(columns);
return new Array(columns);
};