I can already render a list of numbers in angular using the following code in my controller
$scope.range = function(n) {
return new Array(n);
};
and I use it like so
<ul>
<li class="ticked" ng-repeat="a in range(10) track by $index">{{$index + 1}}</li>
</ul>
and it draws 10 pretty
<li>1</li>
...
...
<li>10</li>
as expected
Now I when I am trying to use this code with a scope variable instead of ten i.e
item.itemTickCount
If I output {{item.itemTickCount}} I see 13 but when I try to render
<ul>
<li class="ticked" ng-repeat="a in range(item.itemTickCount) track by $index">{{$index + 1}}</li>
</ul>
I just get 1 <li></li> when it should be 13
What am I doing wrong.
Note I have already tried
range(itemTickCount)
range({{item.itemTickCount}})
track bysyntax, AngularJS marks this as an error so I removed it. idk.item.itemTickCountis probably a string, but should be an integer.