I have an Angular array that contains JSON data. One of the elements is the name of an ionic icon. I am using ng-repeat to loop through the elements and I want to dynamically update the ionic icon name on each iteration.
<div class = "row" ng-repeat="item in serviceList" ng-switch on="$index % 3">
<div class = "col text-center" ng-switch-when="0">
<i class = "services icon ion-laptop">{{ serviceList[$index].IconName }} </i>
</div>
<div class = "col text-center" ng-switch-when="0">
<i class = "services icon ion-laptop">{{ serviceList[$index+1].IconName }}</i>
</div>
In this example I have manually set ion-laptop, but I want to use serviceList[$index].IconName and serviceList[$index+1].IconName }} respectively to update the icon. The above code will output the icon name string, but I cannot figure out how to place that inside of the HTML class tag. Any thoughts?