Created
June 26, 2020 02:11
-
-
Save luislobo14rap/ca75a0b32cd63d216fb4d44f10e056e4 to your computer and use it in GitHub Desktop.
angular-ngFor-using-number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngFor="let index of repeatFor(3)"> | |
{{index}} | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repeatFor(n){ | |
return Array(n).fill(0).map((f,i)=>i); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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