I tried to use an async/await with promise
async getReport(startDate: string, endDate: string){
return await this.http
.get<Report>(
`https://localhost:44354/report?startDate=${startDate}&endDate=${endDate}`,
this.httpOptions
)
.toPromise();
}
getReports(startDate: string, endDate: string) {
this.getReport('2020-03-20', '2020-03-26').then(response => {
let lists= [
{
name: 'Opens',
value: response .opens,
color: 'green',
},
{
name: 'Opens',
value: response .opens,
color: 'green',
}];
});
its possible to use the list outside the promise ? exemple if i want return list from my method getReports ?