angular.js - How to default the background-color of the first element to red during ng-repeat, click on the corresponding element and the background will turn red while changing all other elements to black
过去多啦不再A梦
2017-05-15 17:04:32
It is to dynamically change the style in ng-click. Do you have any ideas or methods? Urgent! Urgent! ! Waiting online! ! ! Please, all the great gods! !
Provide a simple idea:
JS:
HTML:
CSS:
Modify your code like this:
HTML:
controller:
I have answered a similar question to yours raised by another person before. I directly changed the demo I wrote before and sent it to you. It completely meets your requirements. You can preview it and scroll down if you can’t see the effect. Wall, the demo is as follows:
Demo