In my Angular-13 project, I am trying to get the data from API endpoint for chartjs. I have this in the service:
getCurrentEmployeeChart() {
return this.http.get(this.baseUrl + 'current-employee')
.toPromise()
.then((data) => {
return data;
});
}
I got this error:
'(): Promise<Object | undefined>' is deprecated.ts(6385) Observable.d.ts(125, 9): The declaration was marked as deprecated here.
Then:
toPromise()
is crossed.
How do I resolve this?
Thanks