-
Notifications
You must be signed in to change notification settings - Fork 7
09.0.0 Use a Component For Rating
Patrick Baselier edited this page Oct 13, 2015
·
1 revision
- Create a component for rating
See the installation instructions. Use tag 9.0.0.
- Open
frontend/app/templates/products/show.hbs
and within the{{#each model.reviews as |review|}}
helper, replace all the<span class='glyphicon...
tags with{{star-rating starCount=review.rating}}
. - Inspect the error shown in the Console tab in the browser. Ember is missing the
star-rating
component, so let's create this. - In the terminal, from the
frontend
folder enterember g component star-rating
. - Open
app/templates/components/star-rating.hbs
and replace the content with the code from this gist from star-rating.hbs. - Open
app/components/star-rating.js
and replace the content with the code from this gist from star-rating.js.