Add a class selectively to an ng-repeat AngularJS

前端 未结 3 1003
天命终不由人
天命终不由人 2020-12-20 21:27

I have an ng-repeat for a table, I want to be able to add a class when is clicked, and remove the class when un-clicked. Multiple

3条回答
  •  别那么骄傲
    2020-12-20 21:33

    You don't need a special function or controller to accomplish this:

    {{node.name}} {{node.date}} {{node.city}}

    Full Plunker example: http://plnkr.co/edit/1hdcIOfz0nHb91uFWKrv

    I could show you the controller I used by it's empty except for the test data. You don't need a function.

提交回复
热议问题