0

I'm writing an angular app and currently have an li using ng-repeat to display a word (which is working great). I'd like to add a star image next to the word as many times as an associated number in a key value pair, e.g. Angular: 3, would show "Angular" with 3 star imgs. Best way to do this? Here is my code: View:

    <ul class="oneSkills">
            <li ng-repeat="skill in oneSkills">{{skill}}</li>
    </ul>

Controller:

    aP.controller('skillsCtrl', ['$scope', function ($scope) {
       $scope.oneSkills = ["HTML", "CSS", "Sass", "Javascript", "Jquery", "AngularJS"];
       $scope.twoSkills = ["Grunt", "Node", "Ruby on Rails","Adobe Photoshop", "Adobe Illustrator"]; }]);

1 Answers1

0

You could use this method to make it ng-repeat on a star image.

Way to ng-repeat defined number of times instead of repeating over array?

Community
  • 1
  • 1
jonode
  • 797
  • 4
  • 15