- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 233字
- 2021-07-23 19:18:54
Environments
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: false
};
Note that the Boolean true (on production) and false (on development) is the only difference between the two files, at this first stage. It is clear that, in addition to the files that we mentioned, we have a lot of other files within an Angular application, and all of them are extremely important. But, for now, let's focus on these. Don't worry; throughout the course of the book, we will look at more of them in detail, during the development of our example application. For now, we are going to focus on creating the simple example that we are using in this chapter.
- 社交網絡對齊
- 廣電5G從入門到精通
- Cisco OSPF命令與配置手冊
- 物聯網短距離無線通信技術應用與開發
- 物聯網安全(原書第2版)
- Learning QGIS 2.0
- Oracle SOA Suite 11g Performance Tuning Cookbook
- TCP/IP入門經典(第5版)
- Proxmox High Availability
- 互聯網基礎資源技術與應用發展態勢(2021—2023)
- NB-IoT物聯網技術解析與案例詳解
- Metasploit Penetration Testing Cookbook
- 網絡環境中基于用戶視角的信息質量評價研究
- 光纖通信系統與網絡(修訂版)
- Android UI Design