I am currently working on a rating star feature that dynamically displays stars based on information retrieved from the database.
Within my app.ts file, I have declared a variable like so:
this.rating = 4;
Here is an example of how the HTML looks:
<div class="rating-star-group pull-right">
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star"></i>
<i class="zmdi zmdi-star-outline"></i>
</div>
Would it be appropriate to use ng-if to check the variable in order to display the class, or is there a more efficient method?