Created
February 10, 2020 23:33
-
-
Save umutyerebakmaz/ce8edaff264610798206ea81750b2083 to your computer and use it in GitHub Desktop.
Get the array element by index
This file contains 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
toolTips = ['Kötü', 'Orta', 'İyi', 'Çok İyi', 'Mükemmel']; | |
getTooltip(index: number): string { | |
return this.toolTips[index]; | |
} | |
<button mat-icon-button | |
*ngFor="let ratingId of ratingArr; index as i" [id]="'star_'+i" | |
(click)="onClick(i+1)" | |
[matTooltip]="getTooltip(ratingId)" | |
matTooltipPosition="above"> | |
<mat-icon class="material-icons">{{showIcon(i)}}</mat-icon> | |
</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment