I have a list of <p> tags in my Angularjs appication that I would like to set an active class on when any of them are selected using the ng-click directive
<p ng-click="setActive()">Paragraph 1</p>
<p ng-click="setActive()">Paragraph 2</p>
<p ng-click="setActive()">Paragraph 3</p>
I've read one of the best ways to toggle an active class is to push each applicable object into an array and set the class by the array index; is their a simpler way to do this using html elements?
Note* these paragraphs will be rendered dynamically to the DOM as a result of an AJAX request