This is the code I have written:
export interface act {
id: number;
name: string;
}
public list!: act[];
getAll(token:any): void{
this.http.get<act[]>('http://localhost:4200/test', token)
.subscribe(
(val) =>
this.list = val
);
}
However, when I try to assign this.list = val
, I encounter the following error:
Type 'HttpEvent < act[] >' is not assignable to type 'act[]'. Type 'HttpSentEvent' is missing the following properties from type 'act[]': length, pop, push, concat, and 16 more.
I have tried searching on Google and reading through Stack Overflow, but unfortunately, I have not been able to find a solution. While similar questions exist, they either remain unsolved or are not relevant to my specific issue.
I would greatly appreciate your assistance. Thank you in advance.