1

I am trying to read data from config file, but it always returns empty. Do you have any idea what is implemented wrong here? I have added typing.d.ts:

declare module "*.json" {
    const value: any;
    export default value;
}

main.ts

 import {CFactory} from "./local";

const config =  './cacheConfig.json';

const fact = new CFactory();

const cache = fact.getObject();

cache.setConfig = config;
hussain
  • 6,587
  • 18
  • 79
  • 152

1 Answers1

-1

import json file in main.ts

import * as data from './json_filename.json';
Jagdeesh
  • 119
  • 2
  • 14