I need assistance creating a function that removes an icon from a button and replaces it with a spinner provided by primeng. The function should only remove the child element.
Code snippet for the button:
<p-button label="" [loading]="loading" (onClick)="load()" (onClick)="rm()">
<i id="rm_icon" class="pi pi-user-plus"></i>
</p-button>
The rm()
function is intended to remove the existing icon from the button, but only when the loading spinner icon is presented.
I am looking for a way to remove the icon temporarily while the spinner is displayed, as I currently only know how to remove it permanently. My TypeScript skills are limited in this area.