📅  最后修改于: 2022-03-11 15:03:07.258000             🧑  作者: Mango
import { Component } from '@angular/core';
import EmployeesJson from '../assets/employees.json';
interface EMPLOYEE {
id: number;
name: string;
username: string;
email: string;
phone: string;
website: string;
}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Import JSON Data from Assets Folder';
Employees: EMPLOYEE[] = EmployeesJson;
constructor(){
console.log(this.Employees);
}
}Copy