Next, my método
is working correctly, but I would like to do a validation if I can not succeed, letting the user know that I could not adicionarConta()
have any way I can do this?
Webservice method
addConta(conta: ContaInterface){
return this.http.post(this.url+'api/login',conta,{"headers": {'Accept':'application/json','Authorization': 'Bearer '+this.token}});
}
Add method
adicionaConta(){
this.webservice.addConta(conta).subscribe(data=>this.listaContas.push(data));
}