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.
  • 1,173
  • 3
  • 13
  • 22

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
  • 700
  • 5
  • 21