javascript - How to load value of class using angularJs -
i trying add class span same value in ng-repeat.
my html code
<div class="player"> <span ng-repeat="cards in table.player.cards" class="a cards.card"></span> </div>
value of table.player.cards in controller :
table.player.cards = [{"card":"cq"},{"card":"c3"},{"card":"c5"}]
i want assign value of cards.card span. how can it?
do:
<div class="player"> <span ng-repeat="cards in table.player.cards" class="a {{cards.card}}"></span> </div>
you need use curly brackets bring out value of object.
Comments
Post a Comment