I attempted to design an interface in interface.ts. The data consists of an array of objects inside the Column. Below is the code for my interface:
export class User {
result: boolean;
messages: string;
Column=[];
data=[];
}
export class Column {
name:string;
category:boolean;
count:number;
}
export class data {
name:string;
category:string;
}
The following code is used in the service.
getData(): Promise<User> {
return Promise.resolve(
{ result: true, messages: 'Maria','Column':[{
name:'ramu',category:'c',count:4, "data":[{"name":"", "category:""
}]
}]
}
);
}
However, I encountered a type error. I have attached a screenshot below for your reference. Please check and see the error screenshot. Code URL Stackblitz