Giter Club home page Giter Club logo

angular-environment-variables-demo's Introduction

Angular Environment Variables Demo

This project contains a working demo of How to use environment variables to configure your Angular application without a rebuild.

If you have the ability to rebuild your application for use in different environments, the built-in Angular CLI application environments are perfect for storing configuration details.

However, if your application needs to be deployed with a different configuration in different environments without having the ability to rebuild it, this mechanism may be just what you are looking for.

To get a better understanding of the inner workings, make sure to read the article.

Instructions

  1. Run ng build --prod to build the project. The build artifacts (including env.js) will be stored in the dist/ directory.
  2. Serve the contents of the dist directory using a static web server like serve.
  3. Edit env.js in your dist directory to control the environment variables within your Angular application without the need for a rebuild.

As soon as you refresh your browser, the new environment variables are picked up:

Angular Environment Variables Demo

More info

For more information, check out the How to use environment variables to configure your Angular application without a rebuild.

angular-environment-variables-demo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

angular-environment-variables-demo's Issues

Not Working Env

i have just downloaded the Code & run It won't work as shown in Gif file.
change the enableDebug to false but still can't change on the browser. anything I am missing??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.