I want to insert into my Ionic 4 app the button, used in a form when, which once pressed show a ring/circle/spinner on the left during the waiting of the response from the server, during the operation. It is part of the Material Design, but I didn't found anything on the doc. How Can I implement?
The solution I suggested in the comments would look something like this:
<ion-button (click)="doRequest()">
<ion-label > <ion-spinner *ngIf="loading"></ion-spinner> Submit</ion-label>
</ion-button>
export class Component {
loading: boolean;
doRequest() {
this.loading = true;
this.service.makeRequest().subscribe(
res => {
this.loading = false;
// Do something else...
}
);
}
}
UPDATE
Changed to ion-spinner
as @JanP suggested in comments