问题:
...for example... ...例如...
<div class="month" *ngFor="#item of myCollection; #i = index">
...
</div>
Is possible to do something like...可以做类似的事情......
<div class="month" *ngFor="#item of 10; #i = index">
...
</div>
...without appeal to a non elegant solution like: ...没有诉诸非优雅的解决方案,例如:
<div class="month" *ngFor="#item of ['dummy','dummy','dummy','dummy','dummy',
'dummy','dummy','dummy']; #i = index">
...
</div>
? ?
解决方案:
参考一: https://stackoom.com/question/2SXQ5参考二: Angular 2 - NgFor using numbers instead collections