What is meant by 'pause' when async function await expression 'pauses' execution?

Discussão em 'Angular' iniciado por MadCatm2, Setembro 9, 2025.

  1. MadCatm2

    MadCatm2 Guest

    I am very new to the concept of asyncronicity in Javascript and I wanted to make sure I am not misinterpreting what I am reading.

    Consider this pseudo code in some Angular app:

    async ngOnInit() {

    this.responseObject = await this.myService.myGetRequest();

    //do some more stuff down here

    }


    My understanding is that the ngOnInit() will 'pause' or stop execution at await, and NOT execute the code below that line until the promise object(data) is returned? Correct?

    Continue reading...

Compartilhe esta Página