I am trying to change icon (ie plus, minus) on click in expand collapse accordion, I am using Font Awesome
class for icons. I know it is easily possible with jquery but if there is any way in angularjs, then please let me know.
HTML looks like:
<a class="accordion-toggle" data-toggle="collapse" href="#collapseOne{{test}}">
Test
</a>
You should be looking at ng-class
.
Short example...
in your template:
<span ng-click="flag = !flag" ng-class="{ active : flag }">
click me!
</span>
in your css:
.active { color: red; }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.