I have a simple string array that represents classes:
var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.classes = ["one","two","three","four"]; }
I would like to bind them inside the class attribute of a single element as such:
<div ng-controller="MyCtrl"> <div ng-repeat="class in classes" class="{{class}}"></div> </div>
And follow these steps:
<div class="one two three four"></div>
I can not find a resource that explains how to do this. The above code generates:
<div class="one"></div>
How to repeat an INSIDE element using ng-repeat
?
http://jsfiddle.net/Lvc0u55v/788/
source share