0

I have added some json file to my library, but when I build it there is error my.json file not under rootDir.

1 Answers1

0

Assuming you want to access the .json file as part of the application build process (i.e. not via http), you will will need to put it into the assets folder in your project.

More information about the folder structure of an Angular application here.

You can then follow the instructions here to access the data from your components.

Matt Saunders
  • 3,538
  • 2
  • 22
  • 30