1 private fetchData(){
2 const promise = this.httpClient.get(this.apiUrl).toPromise();
3 console.log(promise);
4 promise.then((data)=>{
5 console.log("Promise resolved with: " + JSON.stringify(data));
6 }, (error)=>{
7 console.log("Promise rejected with " + JSON.stringify(error));
8 })
9 }
10
1 private fetchData(){
2 const promise = this.httpClient.get(this.apiUrl).toPromise();
3 console.log(promise);
4 }
5