Using Typescript 3.6.3, and Angular 6, none of these solutions worked for me.
What did work was to follow the tutorial here which says you need to add a small file called njson-typings.d.ts
to your project, containing this:
declare module "*.json" {
const value: any;
export default value;
}
Once this was done, I could simply import my hardcoded json data:
import employeeData from '../../assets/employees.json';
and use it in my component:
export class FetchDataComponent implements OnInit {
public employees: Employee[];
constructor() {
// Load the data from a hardcoded .json file
this.employees = employeeData;
. . . .
}