Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

import file json angular 12

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: python range in javascript 
Javascript :: select2 clear fields 
Javascript :: javascript object tostring 
Javascript :: substring method 
Javascript :: javascript xor 
Javascript :: how to use if in setstate 
Javascript :: Glide Ajax Client Script ServiceNow 
Javascript :: javascript string contains string 
Javascript :: javascript test for empty object 
Javascript :: javascript get closest element by class 
Javascript :: svg to string javascript 
Javascript :: Select All Elements With A Class getElementsByClassName 
Javascript :: check if js property exists in class 
Javascript :: add event listener on width screen resize 
Javascript :: react native svg onpress 
Javascript :: ionic status bar color 
Javascript :: string to jsonobject gson 
Javascript :: react router last page 
Javascript :: javascript string format 
Javascript :: how to integrate redux dev tool to react application 
Javascript :: useref hook react 
Javascript :: js check string for isogram 
Javascript :: ajax file upload from modal 
Javascript :: javascript remove duplicates from array 
Javascript :: js object get type 
Javascript :: js get max value in an array 
Javascript :: is node js faster than python 
Javascript :: Cannot resolve taglib with uri http://java.sun.com/jsp/jstl/core 
Javascript :: axios try catch 
Javascript :: angular refresh token 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =