Hi, hope you can help me. having this: async searchDatoReg(locclave: string, locmail: string) { this.mensaje = null;
return new Promise((resolve) => { this.api.searchProductoLg(locclave, locmail).subscribe( (data) => { if (isUndefined(data[0])) { this.op = 0; this.filtrados = null; console.log('tempx1:'); } else { this.filtrados = { ...data }; this.op = 1; console.log('tempx2:');
} } ) } )
} then: await this.searchDatoReg(locclave, locmail);
if (this.op === 0){ console.log('aca 1') console.log(JSON.stringify(this.filtrados)); this.glo.asignaReg(this.filtrados[0].email,this.filtrados[0].clave,this.filtrados[0].nombre,this.filtrados[0].id); } else { console.log('aca 2'); console.log(JSON.stringify(this.filtrados)); this.glo.asignaReg(locmail,locclave,'',0); }
dosent syncronize the call, should first do this.searchDatoReg(..) then the rest but never does it any hint please
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, hope you can help me.
having this:
async searchDatoReg(locclave: string, locmail: string) {
this.mensaje = null;
return new Promise((resolve) => {
this.api.searchProductoLg(locclave, locmail).subscribe(
(data) => {
if (isUndefined(data[0])) {
this.op = 0;
this.filtrados = null;
console.log('tempx1:');
} else {
this.filtrados = { ...data };
this.op = 1;
console.log('tempx2:');
}
then:
await this.searchDatoReg(locclave, locmail);
dosent syncronize the call, should first do this.searchDatoReg(..) then the rest
but never does it
any hint please