This question is asked by my friend. Just want to know, Could we define *ngFor without defining array in the component for eg. minValues?
<select>
<div *ngFor="let value of minValues; let i=index">
<option class="min-comp form-control">{{index}}</option>
</div>
</select>
minValues = [1,2,3,4, ....... 100] or [1,2,3 ...... 200] or [1,2,3 .... n] // here n would any constant value
I'm thinking, we can't but not sure...
Why do we need to go to component if we just want to repeat *ngFor for n number of times, Can not we do this in a template with clear syntax like repeat ngFor from 1 to 100?
If this question has been asked in the interview what would you say?
Thanks!