I'm currently working on developing a web app using Angular 5. My JSON file has the following structure:
[
{
"id": 0,
"title": "Some title"
},
{
"id": 1,
"title": "Some title"
},
...
]
The JSON file is stored locally, and I have an interface as well:
export interface Book {
id: number;
title: string;
}
My main questions revolve around how to:
- Retrieve data from the JSON file?
- Convert this data into an array of type
Book[]
?