Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make star rating using angular 7 material icon button?

SCENARIO: I have created a ratings option using material icon-button as follow:

Rating

Expected Result:

  • I want to change the color of icon-button up to how much user going to select like this:

enter image description here

  • I need to take value like 3,3.5,4 depending on the users selection.

DEMO

like image 445
PGH Avatar asked Dec 18 '22 18:12

PGH


1 Answers

I have implemented Amazon like rating system (the same requirement as yours) in my Angular 7 application. I have used this sample. This looks simple, less lines of code and you can reuse the widget.

Demo Url: https://angular-material-star-rating.stackblitz.io

like image 174
staticvoidmain Avatar answered Dec 28 '22 09:12

staticvoidmain