Using Angular CLI, we can also create builds for our application targeting various environments, such as development and production. The application will be configured specific to environments. For example, an application may be configured to use staging URLs for APIs in development or staging environments and production URLs of APIs will be configured in a LIVE or production environment. Developers will be manually updating the configuration of the URL as per the environment the application is built on. Angular facilitates to automate this process of creating builds by targeting various environments.
A constant variable environment is maintained in a file named environment.ts. This file will help to override the default values as per the parameter passed when executing the build command.
To use the production file, we need to execute...