Angular decides to jump outside of it's zone when http client request is finished. Why?

164 Views Asked by At

I have something like this:

    public async getTheThing() {
        .....
        
        console.log(`getTheThing a: ${NgZone.isInAngularZone()}`);
        const response = await this.http.get(url, {headers: headerDict}).toPromise();
        console.log(`getTheThing b: ${NgZone.isInAngularZone()}`);

        return response.someValue;
    }

the output is:

getTheThing a : true
getTheThing b : false

Is this supposed to be normal? If it is normal then why is my UI not refreshing correctly?

0

There are 0 best solutions below