0
How do I put a spinner in a button and this spinner will disappear only when the data is sent.... In case the data is not sent or give some problem in the server the spinner is there loading. I am a few days trying and not conisgo. Who can help I thank.
cadastro.component.ts
salvar(){
this.servico.cadastrar(this.foto).subscribe(()=>{
this.mensagem = `Cadastro feito com sucesso`;
this.foto = new FotoComponent();
setTimeout(()=> this.mensagem ='',
2000)});
} }
cadastro.component.html
<form (ngSubmit)="salvar()" class="col-sm-6">
<div class="form-group">
<label>Título</label>
<input name ="titulo" [(ngModel)]="foto.titulo" class="form-control" />
</div>
<div class="form-group">
<label>URL</label>
<input name="url" [(ngModel)]="foto.url" class="form-control" />
</div>
<div class="form-group">
<label>Descrição</label>
<textarea
class="form-control"
name="descricao"
[(ngModel)]="foto.descricao"
>{{ foto.descricao }}</textarea
>
</div>
<button type="submit" class="btn btn-default">Salvar</button>
<a [routerLink]="['']" class="btn btn-default">Voltar</a>
</form>
Do you use any icon packs? If so, which?
– Leonardo Getulio