I'm using font awesome icons (minus and plus) in an angular app. The plus icon changes to minus when my list expands and the minus turns to plus when the list collapses. For some reason, clicking on the icon results in redirection to my home page. How can I prevent that from happening? What I'm looking for is when the plus icon is clicked, it expands my list, but keeps me on the same page and when the minus icon is clicked, it collapses my list, but keeps me on the same page (i.e., no redirection). Here's my code:
<div>
<a (click)="toggle(filters[0])" data-toggle="collapse" href="#coverageFilters" role="button" aria-expanded="true" aria-controls="coverageFilters"><fa-icon icon="{{filters[0]['collapse'] ? 'plus' : 'minus'}}"></fa-icon> {{filters[0].name}}</a>
<div class="collapse show multi-collapse" id="coverageFilters">
<ul class="filter" *ngFor="let item of filters[0].value"><input type="checkbox"> {{item}}</ul>
</div>
</div>
Here's the code for the toggle function:
toggle(item){
if (item['collapse'] == false){
item['collapse'] = true;
} else {
item['collapse'] = false;
}
}
Do I have to change any default settings for the icons? If yes, where can I find them and which settings should I change?