.subscribe中的调用函数如何

时间:2019-06-04 20:49:11

标签: angular

如果ListPatients函数成功执行,我需要执行一个函数,我应该在其中添加

this.dataApiService.ListPatients()
  .subscribe((
    data : PacienteInterface) =>(this.pacienteLista = data),
    error => this.mensajeError(error)
    );

1 个答案:

答案 0 :(得分:0)

那是什么?

this.dataApiService.ListPatients()
    .subscribe((data: PacienteInterface) => {
        this.pacienteLista = data;
        // functionToCall();
    }, error => this.mensajeError(error));