Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70434

Two httpClient request and one reference

$
0
0

Hi,

I have auth.service.ts with HttpClient variable loaded from constructor with method for calling my api to get information about user and his privileges and if he has still valid token. I calling this method in constructor of my app.component.ts. Its working fine. But, in same page typescript files, I calling api to get initial data for that page. In that pages I have variable of HttpClient defined from constructor.

  1. problem: And because if that, sometimes I get response from second request soon then from first.
  2. problem: If I am not wrong, every HttpClient reference define in constructor for every page has same reference. Because If I call two request in same time, on of the response is every time empty.

Any idea how to resolve this? Thank you.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70434

Trending Articles