I am currently employing ngFor to iterate over a collection of a specific type [Menu] within Angular 4.x.
During this process, I am looping through a collection property of the menu object (menu.items).
Unfortunately, my IDE (Eclipse + Angular IDE) is unable to recognize this property, even though the Menu class distinctly defines the items property as an array of MenuItem.
Is there a possible solution to this issue?
https://i.sstatic.net/fJHnN.png
The class declarations that are relevant include -
export class MenuBase {
id: string;
title: string;
isPublic: boolean;
roles: string[];
items: MenuItem[];
position: number;
// the rest of the class has been omitted
}
export class MenuItem extends MenuBase {
menuItemType: MenuItemType;
callback: () => void;
location: string;
constructor (options: any) {
super(options);
this.location = options.location;
this.menuItemType = options.menuItemType || MenuItemType.location;
this.callback = options.callback;
}
}
export class Menu extends MenuBase {
constructor (options: any) {
super(options);
}
}
Additional details
The project I was working on can be found at: https://github.com/savantly-net/ngx-menu. Even though it's valid, the project displays an error in Eclipse.
Although no documentation was created by me, I utilized it from here - https://github.com/savantly-net/sprout-platform/tree/master/web/sprout-web-ui