Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Methods to wait for subscribe till i get complete response from api

I have applied subscribe method using angular 6. The problem is my api sometime may take time to send back response for an hour. I want browser or subscribe method to wait until i get complete response. Here is the code snippet

    handleUpload(e){
        this.filePath1 = e.target.files[0].name;
        this.data1.getData(this.filePath1).subscribe(async data=> {
        await this.s(data);
        this.dataList.push(JSON.parse(this.s));
        this.result = this.dataList[0].split("\n");

         });

Comments