Reading Local JSON Files Using Angular HttpClient

You can use to import JSON files in your Angular application is Angular HttpClient. Let’s see this by example. First, you need to import HttpClientModule in your app. Open the src/app/app.module.ts file and update it as follows: Next, add data.json file to the src/assets folder. Next, open the src/app/app.component.ts file, import and inject HttpClient as follows: Next, open the src/app/app.component.html file Source Code File