It seems like this question has been asked before, but I can't seem to find the answers or know what terms to search for.
I have a JSON file structured like this:
{
"pages": [{
"displayname": "PageA",
"url": "http://google.de",
"icon": "iconZ"
},
{
"displayname": "PageB",
"url": "http://www.pageb.co.uk",
"icon": "iconY"
}
],
"icons": [{
"alias": "iconZ",
"filename": "iconZ.svg"
},
{
"alias": "iconY",
"filename": "iconY.svg"
}
]
}
Currently, I am using the HttpClient (referred to as httpService) to fetch this data from the file.
this.httpService.get('./assets/pageconfig.json').subscribe(
data => {
this.arrAdress = data as string[];
},
(err: HttpErrorResponse) => {
console.log(err.message);
}
);
I am looking to use the 'pages' content in my ngFor loop in the Frontend and I also need an array of the icon data for use in the Backend. How can I extract this data based on the properties?
Appreciate your assistance, Elias