So, I know there is the *ngFor
to loop several times, but this loop only works with an array. Is there a way of doing this loop with number?
I'd like to:
<a href="#">1</a>
<a href="#">2</a>
<a href="#">3</a>
<a href="#">4</a>
<a href="#">5</a>
Like this:
<a href="#" *ngFor = "let pagina of paginas">{{pagina}}</a>
But I'd like to pass a number to paginas
, instead of an array.
In PHP would be something like this:
for($i = 1; $i <= 5; $i++) {
...
}
<a href="#" *ngFor = "let pagina of paginas">{{index}}</a>
. The index is available through Angular. – Phil Cap Jan 10 '17 at 9:49paginas
needs to be an array. – William Jan 10 '17 at 9:50for
... – William Jan 10 '17 at 9:52