Type 'Promise<string[]>' is not assignable to type 'string[]'
Assume your response from http.get
is an array, here you are returning Promise
from function memberService.getmemberheader
, you should retrieve result of promise at its then
callback instead (not assigning promise itself to array doughnutChartLabels
).
public doughnutChartLabels: string[];
this.memberService.getmemberheader().then(res => {
this.doughnutChartLabels = res;
})