Skip to content

Instantly share code, notes, and snippets.

@navix
Created February 11, 2019 11:57
Show Gist options
  • Select an option

  • Save navix/bc8fc48df1fc825d4e7f67f3c5bec0c1 to your computer and use it in GitHub Desktop.

Select an option

Save navix/bc8fc48df1fc825d4e7f67f3c5bec0c1 to your computer and use it in GitHub Desktop.

Revisions

  1. navix created this gist Feb 11, 2019.
    19 changes: 19 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    # Import JSON into Angular 7 during build

    #### `typings.d.ts`

    ```typescript
    declare module '*.json' {
    const value: any;
    export default value;
    }
    ```

    #### `content.ts`

    ```typescript
    import * as contentRaw from './content.json';

    // Declare proper types instead `any`
    export const content: any = contentRaw;
    ```