Angular: Read json file and inject content to module as dependency

488 Views Asked by At

I have an angular project with lazy loaded modules with Core and shared modules. Each module has some json configuration files that i need to use their contents in the components with dependency injection.

Which walkthrough is better for this:

1- Read json files with a file reader service on loading each module and add the mapped object in DI.
(Can this happen? dynamically read the json file on module loading and inject the object as dependency?)

2- Read json file on loading component and use its data.

3- Other scenarios?

0

There are 0 best solutions below