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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -