I'm just starting to learn about Angular and I am having trouble getting the interface class to work properly.
export interface Header {
parentTitles: string;
childHeaders: ChildHeader[];
titleIcon: string;
url: string;
}
export interface ChildHeader {
childTitles: string;
siblingHeaders: SiblingHeader[];
icon: string;
url: string;
}
export interface SiblingHeader {
siblingTitles: string[];
icon: string;
url: string;
}
In my comp.ts file, I have the following code:
headers: Header = [
{
parentTitles: 'Settings',
childHeaders: ChildHeader = [{
childTitles: 'General Setup',
siblingHeaders: SiblingHeader = [{
siblingTitles: ['Vessel', 'Port', 'Owner', 'Engine Type',
'Vessel Type'],
icon: '',
url: ''
}],
icon: '',
url: 'home/general-setup'
}]
}
];
The issue is that the ChildHeader and SiblingHeader are showing up as undefined. Can someone help me figure out how to fix this?
Thank you!