-1

I need to execute the a function in case the ListPatients function is successful, where I should add it

this.dataApiService.ListPatients()
  .subscribe((
    data : PacienteInterface) =>(this.pacienteLista = data),
    error => this.mensajeError(error)
    );
Luis Angel
  • 41
  • 6
  • 1
    In the call back: `=> { this.pacienteLista = data; this.someFunction(); } ` – Igor Jun 04 '19 at 20:52
  • 1
    Possible duplicate of [How do I return the response from an asynchronous call?](https://stackoverflow.com/q/14220321/1260204) – Igor Jun 04 '19 at 20:52

1 Answers1

0

what about that?

this.dataApiService.ListPatients()
    .subscribe((data: PacienteInterface) => {
        this.pacienteLista = data;
        // functionToCall();
    }, error => this.mensajeError(error));
rala
  • 895
  • 2
  • 18
  • 43