Type ‘Promise’ 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;
})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)