ahmed salah

ahmed salah

  • 1.1k
  • 631
  • 40.3k

How to execute getactive session function before compare excel functio

Apr 18 2022 4:13 AM

I work on angular 8 i have two subscribe
i need to execute first subscribe and after finish
execute second subscribe
but i don't know how to make it please ?
first function i need to execute is
getactivesession

second function i need to execute it
compareexcel
so how to do that please ?

execute it first
this._dataService.getActiveSessions(flagButton).subscribe(resp => {
      if (resp) {
        alert('There are active session working')
      } else {
        console.log('nooo');
      }
    });

execute it second
this._dataService.CompareExcel(this.selectedoptions,this.fileToUpload).subscribe(resp => {
        if (resp) {
          this._dataService.PostUpload(this.selectedoptions,this.fileToUpload)
      .subscribe(blob => {
      saveAs(blob.body, this.fileToUpload.name +'.xlsx');
       });

 


Answers (3)