Configuring Your Angular Application to Use an External Configuration File
Normally, developers use the environment.ts and environment.prod.ts files (and maybe even other permutations) to configure their Angular applications for different environments. With a deployment system such as Octopus , symbols can be placed in these files to replace values with environment-specific ones. But what if you want to build an Angular application for use by someone outside of such an environment? I ran into this problem recently when working on an application I have up on GitHub. I wanted to be able to provide a release that someone could easily configure without having to do a find/replace inside a JavaScript file. As long as the application is not offline, you can add a configuration file which gets distributed with your application and have the app read from it during initialization. First, create a new configuration file. In my case, I added config.json under my src folder: In this file, I currently just have a single configuration option: the URL to my API. { &qu