Encountering a specific error, I am aware of what the code signifies but unsure about the correct interface format:
An error is occurring due to an 'any' type being implicitly assigned as the index expression is not of type 'number'.
Here are the interfaces:
export declare interface Category {
id: string;
name: string;
parent_id: string;
}
export declare interface CategoriesMap {
[key: string]: Category;
}
Related component snippet:
private listOfSubcategories: CategoriesMap[] = [];
private selectCategory($event: any, index: string) {
this.category = this.listOfSubcategories[index][$event.target.value];
}
Thank you.