How to display "n" icons on view where n is int value of a variable


This may be a noob question. I am currently learning Ionic and Angular in parallel and I was looking for a clean way to display to display a number of icons that is equal to an int stored in a variable that is set by a range.

I currently have my code set up to have the user set the range and then save that range on one state then on another state display an int value corresponding with that range.

How would I go about displaying a number of icons equal to that range? Would I just declare a function for when the state loads that takes the int value and then modify the view with “n” number if tags?


Show us what have you done so far?


Here is a quick example:

Here is my project so far:

For some reason plnker doesn’t want to place nice even though it runs fine on my browser(s), emulator, and android device.

I basically am interested if there is a quick ionic/angular way to display a number of ionicons equal to the value of notes.priority.

I am pretty new to angular and ionic-so my idea of just making a function in my notestore service to just edit the view based on on the notes.priority variable may be incorrect?


You want to use ng-repeat. See this forked example: