<button type="button" class="btn btn-primary" (click)="height = height ? 0 : el.scrollHeight">
Toggle button<span id="Section1_togglearrow" class="pull-right fa fa-caret-up" style="margin: 2px auto; font-size: 20px;"></span>
</button>
I have the code as mentioned above.
I want to change the span class to "pull-right fa fa-caret-down" if height is 0.
If height is the element height then I want to set the class to "pull-right fa fa-caret-up". How to achieve this using angular2.
Basically I am trying to toggle and I want to change the icon on toggling.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…