I am using Angular 5 to develop a web app. I have JSON file which looks like this:
[
{
"id": 0,
"title": "Some title"
},
{
"id": 1,
"title": "Some title"
},
...
]
This file is stored locally. I also have an interface:
export interface Book {
id: number;
title: string;
}
The questions are how do I:
- Fetch the data from the file?
- Create an array of type
Book[]from this data?