Ionic3-star-ratting - identifying who sent the value


I have 3 ionic3-star-rating objects in a view, according to the manual I need to use the Events to receive the rating values ​​in the controller. How do I differentiate which object triggered the event? Because of the way an event is placed in the manual, it modifies the rating value of the three objects. The manual used is

events.subscribe('star-rating:changed', (starRating) => {console.log(starRating)});


Ok, I have attached a click event on rating tags in the html file. When the user clicks, I noticed that star-rating:changed event fires before the click event. So, we store the rating in an instance variable and attach a click event to each rating tag and then send the type of rating element clicked as it’s parameter and set the values accordingly.


Look at About Page there(both html and ts file).

1 Like

Cool Vivek! The code is very simple. Thanks for the feedback.

1 Like