I want to store data like thispublic initData: any = ['Group 1', 'Group 2', 'Group 3'];.
I am calling an API and It gives this response

I declare private initData: any; and after getting the response I try to store in that like this
this.userService.getUserRolesById(this.id)
.subscribe(data => {
this.initData = data.Name;
console.log(this.initData);
})
userservice
public getUserRolesById(id: number) {
return this.httpHelper.get(this._getUserRolesByIdUrl+'?userId='+id)
.map(res => res.json());
}
userService.getUserRolesByIdimplementation?