0

In Angular a JSON file can be imported very easy with

import * as data from './mock.json';

when setting "resolveJsonModule" in tsconfig.json to true.

Is there a comparable functionality to import csv files?

Sebastian S.
  • 825
  • 2
  • 10
  • 19

1 Answers1

0

You need to change angular's web-pack configs with @angular-builders/custom-webpack and then use something like csv-loader

Check out Angular CLI: Custom webpack Config for using @angular-builders/custom-webpack, and also check out Adding a csv file to a webpack build

R Pasha
  • 695
  • 5
  • 21