As a newcomer to Angular and Typescript, I am facing a challenge while declaring a property with a complex array as one of its values. Here is what I have attempted:
groupedItem: {
customGroupId: string,
cgName: string,
category: [{
customGroupItemId: string,
name: string }]
};
But when I try to access the property
this.groupedItem.category.name
An error message pops up saying
Property 'name' does not exist on type '[{ customGroupItemId: string; name: string; }]'
It seems like the 'name' property is there. Any idea what mistake I might be making?