i'm using Ionic 2 Framework and so Angular 2 and Ts.
In my ts file i have a variable, let's say 'round' and an object 'textblocks'
round:number;
textblocks=[{hello:'hi'},{hello:'there'},{hello:'john'},{hello:'doe'}];
'Round' value is changing during the life of the application (0 to 3).
Then in my html file, I have a list:
<ul>
<li>{{textblocks[round].hello}}</li>
</ul>
I can use a ngFor to display as much 'li' as the number in the variable 'round', each displaying the text in the corrispondent textblocks[round].hello, with 'round' increasing while the view is used?
Example when round is 1
<ul>
<li>{{textblocks[0].hello}}</li>
<li>{{textblocks[1].hello}}</li>
</ul>
that is
- hi
- there
Example when round is 3
<ul>
<li>{{textblocks[0].hello}}</li>
<li>{{textblocks[1].hello}}</li>
<li>{{textblocks[2].hello}}</li>
<li>{{textblocks[3].hello}}</li>
</ul>
- hi
- there
- john
- doe