Last active
August 20, 2020 05:20
-
-
Save aman-gautam/8a25e2906003e7caaa3e261c69c3810d to your computer and use it in GitHub Desktop.
Ionic stars implementation. For some reason, many developers prefer the more complex packages, for simple use cases this is enough.
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
<!-- For a rating of 1 to 5 stars --> | |
<!-- Editable --> | |
<ion-item> | |
<ion-icon | |
*ngFor="let i of [1,2,3,4,5]" | |
(click)="value = i" | |
[color]="value < i? '': 'primary'" | |
[name]="value < i? 'star-outline': 'star'"> | |
</ion-icon> | |
</ion-item> | |
<!-- Read Only --> | |
<ion-item> | |
<ion-icon | |
*ngFor="let i of [1,2,3,4,5]" | |
[color]="value < i? '': 'primary'" | |
[name]="value < i? 'star-outline': 'star'"> | |
</ion-icon> | |
</ion-item> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment