July 2018
Intermediate to advanced
420 pages
8h 46m
English
Inside of the src/environments folder, we find two configuration files. One is called environment.prod.ts, and the other is environment.ts. The Angular CLI will know what to use, depending on the command that we use; for example, consider the following command:
ng build --env = prod
If we use it, then Angular will use the environment.prod.ts file, and, for the other commands, such as ng serve, it will use environment.ts. This is very useful, especially when we have a local API and one in production, using different paths.
Both files have almost the same code; see environment.prod.ts, as follows:
export const environment = { production: true};The environment.ts file is as follows:
export const environment = { production: ...Read now
Unlock full access