c# .net Adsense ADO.NET Linq Viruses/security asp.net MVC JQuery Angular-js Node-js SEO Java C++ SQL API Networking vb.net .Net Css JavaScript Generics c#.Net entity framework HTML Website host Website Construction Guide HTTP tutorial W3C tutorial Web Services JSON Psychology Ionic framework Angular ReactJS Python Computer Android
Angular

cannot find module consider using '--resolvejsonmodule' to import module with json extension angular

| | angular
I got this following error "cannot find module consider using '--resolvejsonmodule' to import module with json extension angular" while tried to import the json file in the component.
import module with json extension angular error
To solve this error, we need to create a file named 'json-typings.d.ts' in app root folder and add this code.

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