Maybe use angular2 in the template,
something like the following:for int a = 0; a < numberTest; a++
this test number is in the code component:
numberTest: number = 5;
and a template, something like this, is better to illustrate what I mean:
<li *ngFor="#int a = 0; a < numberTest">
I know that this can be solved using an array and, for example, iterate:
<li *ngFor="#item of items">
but my question is, if possible, create a for template that accepts a value condition using a component variable, hopefully I will explain well.
source
share