Answers for "use promise in angular 8"

3

use promise in angular 8

private fetchData(){
    const promise = this.httpClient.get(this.apiUrl).toPromise();
    console.log(promise);  
    promise.then((data)=>{
      console.log("Promise resolved with: " + JSON.stringify(data));
    }, (error)=>{
      console.log("Promise rejected with " + JSON.stringify(error));
    })
  }
Posted by: Guest on January-06-2021
1

use promise in angular 8

private fetchData(){
    const promise = this.httpClient.get(this.apiUrl).toPromise();
    console.log(promise);       
  }
Posted by: Guest on January-06-2021

Code answers related to "use promise in angular 8"

Code answers related to "Javascript"

Browse Popular Code Answers by Language