Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Created June 26, 2020 02:11
Show Gist options
  • Save luislobo14rap/ca75a0b32cd63d216fb4d44f10e056e4 to your computer and use it in GitHub Desktop.
Save luislobo14rap/ca75a0b32cd63d216fb4d44f10e056e4 to your computer and use it in GitHub Desktop.
angular-ngFor-using-number
<div *ngFor="let index of repeatFor(3)">
{{index}}
</div>
repeatFor(n){
return Array(n).fill(0).map((f,i)=>i);
}
<div>
0
</div>
<div>
1
</div>
<div>
2
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment