I am working with an object that is connected to the $scope
in my Angularjs application
{name: 'Vampire Cafe', rating: 4, review: "Food was good, cafe was a bit dark..."}
I want to display the value of the rating
by showing a certain number of icon elements on the DOM equal to that value
For example, if the object above has a rating of 4, I would like to repeat the following element 4 times in the DOM:
<h3>Rating</h3>
<i class="icon-ios-star"></i>
<i class="icon-ios-star"></i>
<i class="icon-ios-star"></i>
<i class="icon-ios-star"></i>
Is there a simple way to achieve this using an Angularjs expression?