Import json file in typescript Angular 5
问题 I am trying to import json file in typescript class like that import * as nationalities from './mock/nationalities.json'; and it gives me an error Cannot find module './mock/nationalities.json'. and to solve this issue I added this declare module '*.json' { const value: any; export default value; } but it doesn't solve my issue and also gives my another error exception Invalid module name in augmentation, module '*.json' cannot be found. My Typescript version 2.9.2 回答1: Based on this post,