facebook

What are Angular Application Environments? And how to add your own?

What are Angular Application Environments? And how to add your own?
Average rating: 0
(0 votes)

Thanks! You’ve rated this material!

If you want to know more about Angular application, you can read our blog article about Akita state management pattern. Today, we will explain how to create a new environment with our own configuration and will answer the questions what are Angular Application environments? And how to add your own?

An Angular Application Environment is JSON configuration information that tells the build system which files to change when you use ng build and ng serve.  This article is targeted at Angular 6 which really improved both the ease of use and the documentation for Application Environments.

In the tutorial you will go through:
1. Creating ng-configuration using Angular CLI
2. Learning using Angular configurations: replacing environment.ts file with the contents of the environment.prod.ts file
3. Building a simple environment example that shows how to switch between our default and production configurations
4. Modifying Configuration Information by updating the object with the name of the environment.

After that we can serve our application using the test environment:

ng serve --configuration=test

Use Angular Application Environments when you need a convenient way to manage configuration information for your applications and find the examples of code on every stage here, in the article by Todd Palmer

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111