Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Angular 2 loop without a collection?

$
0
0

@crkvend wrote:

Hi guys,

I'm having some trouble finding info on this so I'll try asking here. I hope it's ok, since it's not really Ionic 2 related.

I''m trying to create a simple for-loop like this:

ngFor only seems to work with collections, so in my class, I have to define define "range" like this:
private range:number[] = [1, 2, 3, 4, 5];

This seems iffy to me, and I would much rather have range to be a number constant. Do you guys know if there really is an angular limitation for loops through collections only?

Thanks!
/Daniel

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>