Compile time configuration options allow you to provide different kind of settings based on the environment you're building the Angular app for. You might for instance have a development, staging and production environment. With the Angular CLI you're already perfectly set up. Whenever you compile your app, you just pass the --env=<your-environment> to the CLI. The according settings will then be compiled into your app. But let's take a closer look how that works and how you can define new environments by yourself

You can add env setting in environement folder, or even create new environement file.

For example:

  1. //environment.staging.ts
  2.  
  3. export const environment = {
  4. production: true,
  5. appTitle: 'NG app (staging)'
  6. };

Run the env:

  1. "build:staging": "ng build --prod --env=staging",

[Angular] Configure an Angular App at Compile Time with the Angular CLI的更多相关文章

  1. Angular.JS + Require.JS + angular-async-loader 来实现异步加载 angular 模块

    传统的 angular 应用不支持异步加载模块,必须在 module 启动的时候,所有模块必须预加载进来. 通过使用 angular-async-loader 库,我们可以使用 requirejs 等 ...

  2. [Angular] Configure an Angular App at Runtime

    It always again happens (especially in real world scenarios) that you need to configure your Angular ...

  3. [Angular Tutorial]PhoneCat Tutorial App

    (注:曾经在<不敢止步>一书中看到学到一个观点,作者认为学习一门技术最好的方法就是翻译某部领域书籍.这里我决定做一次尝试,接下来花1个月左右时间,将Angular Tutorial Pho ...

  4. 002——Angular 目录结构分析、app.module.ts 详解、以及 Angular 中创建组件、组件 详解、 绑定数据

    一.目录结构分析 二. app.module.ts.组件分析 1.app.module.ts 定义 AppModule,这个根模块会告诉 Angular 如何组装该应用. 目前,它只声明了 AppCo ...

  5. Angular 学习笔记 ( PWA + App Shell )

    PWA (Progressive Web Apps) 是未来网页设计的方向. 渐进式网站. Angular v5 开始支持 pwa 网站 (所谓支持意思是说有一些 build in 的方法和规范去实现 ...

  6. [Angular] Read Custom HTTP Headers Sent by the Server in Angular

    By default the response body doesn’t contain all the data that might be needed in your app. Your ser ...

  7. [Angular Directive] Assign a Structual Directive a Dynamic Context in Angular 2

     Just like passing in an array to *ngFor, you can pass in any value into your structural directive s ...

  8. [Angular Directive] Implement Structural Directive Data Binding with Context in Angular

    Just like in *ngFor, you're able to pass in data into your own structural directives. This is done b ...

  9. [Angular] Create a custom validator for template driven forms in Angular

    User input validation is a core part of creating proper HTML forms. Form validators not only help yo ...

随机推荐

  1. javaScript - 面向对象 - ES5 和 ES6

    javaScript - 面向对象 - ES5 和 ES6 ES5之前用 构造函数 构造函数的特点 就是一个普通函数, 他的函数名要大写.: 带方法的写法: 原型的方式: prototype 为内置的 ...

  2. where和having

    where可以不能使用别名作为过滤条件,而having可以使用别名作为过滤条件. 在ORACLE中,select 语句的执行顺序是: 1. from语句 2. where语句(结合条件) 3. sta ...

  3. 循环语句第1种 LOOP ... END LOOP;

     7)循环语句  --------第1种----------   LOOP ... END LOOP;    declare    n number(3) := 1;  begin    LOOP   ...

  4. ofbiz初级教程

    本教程是ofbiz 基本应用,它涵盖了OFBiz应用程序开发过程的基本原理.目标是使开发人员熟悉最佳实践,编码惯例,基本控制流程以及开发人员对OFBiz定制所需的所有其他方面. 本教程将帮助您在OFB ...

  5. 洛谷—— P1640 [SCOI2010]连续攻击游戏

    https://www.luogu.org/problem/show?pid=1640 题目描述 lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1, ...

  6. Android自己定义组件系列【4】——自己定义ViewGroup实现双側滑动

    在上一篇文章<Android自己定义组件系列[3]--自己定义ViewGroup实现側滑>中实现了仿Facebook和人人网的側滑效果,这一篇我们将接着上一篇来实现双面滑动的效果. 1.布 ...

  7. Eclipse 更新Android SDK后,新建项目出现appcompat_v7project的相关问题

    Eclipse 更新Android SDK后,新建项目出现各种问题.网上各种解决方式,搞了好久,总结一下. 1.出现error: Error retrieving parent for item: N ...

  8. bzoj1570: [JSOI2008]Blue Mary的旅行(二分+网络流)

    1570: [JSOI2008]Blue Mary的旅行 题目:传送门 题解: get到拆点新姿势,还是做题太少了...ORZ 因为每天就只能有一个航班,那就不能直接连了,所以要拆点(然后就被卡住了) ...

  9. m_Orchestrate learning system---三、session使用完整流程是什么

    m_Orchestrate learning system---三.session使用完整流程是什么 一.总结 一句话总结: 1.在登录成功之后设置session和cookie 2.在公共控制器里面使 ...

  10. m_Orchestrate learning system---十九、局部变量和块变量是什么

    m_Orchestrate learning system---十九.局部变量和块变量是什么 一.总结 一句话总结:下面的global的使用情况可以很好的解释这个问题 这是在一个函数里面,只不过里面有 ...