But a very simple thing, but I cannot figure out how to display an array of strings in an html template in angular2.
.html
<ul>
<li *ngFor="#number of numberOptions">
{{number}}
</li>
</ul>
.ts
this.numberOptions= ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"];
The above trick doesn't work for me, the text editor shows an error for #numberat ngFor. Is it obsolete in new versions? or am I doing something wrong here?
source
share