I'm starting to learn AngularJS. I'm experienced with JavaScript/jQuery but I'm having some difficulty right now understanding the basics of AngularJS. I have a quick question for anyone with the slightest bit of experience.
I have a table that will displays "users" (which will come from a GET query).
Each "user in users" will have schema like: {name:'', rating:4, reviews:10}
Rating is an int from 1 to 5, where each represents a star (out of 5 possible stars). For each int in rating I would like to draw an IMG tag that shows a single star.
So I have something like this:
<tbody>
<tr ng-repeat="user in users">
<td>{{user.name}}</td>
<td>
<img src="star.jpg" ng-repeat="n in 1 .. user.rating">
</td>
<td>{{user.reviews}}</td>
</tr>
</tbody>
Any idea how to setup that loop properly? Obviously that doesn't work. I would like it to use {{user.rating}} to determine how many stars it needs to draw.
Thanks for your assistance.