Open balinterdi opened 6 years ago
A tentative API for the component would look like this:
{{#star-rating
item=song
rating=song.rating
on-click=(action "updateRating" song) as |stars|}}
{{stars.full-stars class="glyphicon glyphico-star"}}
{{stars.empty-stars class="glyphicon glyphicon-o-star"}}
{{/star-rating}}
The full-stars
and empty-stars
would still render the right amount of stars from each but the API would be more flexible and elegant and wouldn't be tied to one specific icon library (even if allowing overwriting the classes)
The component now applies the appropriate
glyphicon
classes which makes it work with Bootstrap out-of-the-box.The setting is overridable through
fullClassNames
andemptyClassNames
but it'd be much better to not apply any css classes by default and have the caller provide the classes.https://github.com/balinterdi/ember-cli-star-rating/issues/10 can help with providing out-of-the-box components for Font Awesome, Glyphicon, etc.