Skip to content

Instantly share code, notes, and snippets.

Created May 17, 2019 21:25
What would you like to do?
Import JSON in Angular
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import jsonCfg from '../../../data/config.json';
export class AppCfg {
constructor(private http: HttpClient) {}
load(): Promise<void> {
return new Promise<void>((resolve, reject) => {
const jsonFile = <unknown>jsonCfg;
this.customCfg = <any>lokalumJsonFile;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment