[Angular] Configure an Angular App at Compile Time with the Angular CLI
2023-09-14 08:59:17 时间
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:
//environment.staging.ts export const environment = { production: true, appTitle: 'NG app (staging)' };
Run the env:
"build:staging": "ng build --prod --env=staging",
相关文章
- [Angular] Angular Router Extra Options - Recommended Settings
- [Angular] Configure Anuglar CLI to generate inlineTemplate and inlineStyle
- [Angular] Progress HTTP Events with 'HttpRequest'
- [Angular] Using the Argon 2 Hashing Function In Our Sign Up Backend Service
- [Angular] Use Angular’s @HostBinding and :host(...) to add styling to the component itself
- [Angular 2] Create template with Params
- [Angular 2] 9. Replace ng-modle with #ref & events
- [AngularJS]1. Fisrt App, ng-app, Exprection{{}}
- [Angular] Upgrade existing Angular app to Progressive Web App
- [Angular] Component's dependency injection
- [Angular] Configure an Angular App at Runtime
- [Angular] Zones and NgZone
- [AngularJS] Using angular.bootstrap to Initialize Your App
- [Angular] In angular world and out angular world
- 让 Angular 应用动起来!
- 命令行启动Angular应用
- Angular sort recursive的实现原理
- 关于 Angular 工程文件 angular.json 里的 inlineCritical 属性
- Angular InjectionToken APP_INITIALIZER 的实现方法介绍
- 关于 Angular Component ngOnDestroy 钩子函数的调用时机
- Angular里setTimeout和change detection的关系
- Angular应用里的tsconfig.app.json
- Angular应用内路由(In App Route)的最佳实践
- ios xcode 怎样模拟app被挂起(在后台被系统杀死) APP 的五种状态
- The resource could not be loaded because the App Transport Security policy requires the use of a sec
- ios xcode app被杀死了怎样打印调试 调试手动点开的APP 被系统唤醒的app的调试
- App Thinning(为什么苹果app上传时的包比在appStore下载下来的包大很多)
- 〖Python APP 自动化测试实战篇⑨〗- 实战 - App自动化实战操作