Skip to content

Environment Variables #8418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
raed667 opened this issue Nov 9, 2017 · 5 comments
Closed

Environment Variables #8418

raed667 opened this issue Nov 9, 2017 · 5 comments

Comments

@raed667
Copy link

raed667 commented Nov 9, 2017

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x ] feature request

Versions.

@angular/cli: 1.4.6
node: 6.10.3
os: win32 x64
@angular/animations: 4.4.6
@angular/cdk: 2.0.0-beta.12-a7faebc
@angular/common: 4.4.6
@angular/compiler: 4.4.6
@angular/core: 4.4.6
@angular/forms: 4.4.6
@angular/http: 4.4.6
@angular/material: 2.0.0-beta.12-a7faebc
@angular/platform-browser: 4.4.6
@angular/platform-browser-dynamic: 4.4.6
@angular/router: 4.4.6
@angular/cli: 1.4.6
@angular/compiler-cli: 4.4.6
@angular/language-service: 4.4.6
typescript: 2.6.0-rc

Repro steps.

There is no way to pass a variable from ng command to application, like in node applications.

MYAPIKEY=XYZ ng serve

Desired functionality.

To have something like

process.env
@scurk1415
Copy link

You can have multiple environments.

make a new environment environment.test.ts add it in you app cli config

"environments": { "dev": "environments/environment.ts", "test": "environments/environment.test.ts", "prod": "environments/environment.prod.ts" }

and run it wit h ng serve --env=test

@raed667
Copy link
Author

raed667 commented Nov 10, 2017

Yes,

But that requires creating different files, I would like for example to set a URL that changes every build, it would be very impractical to create a new environment file every time.

@raed667
Copy link
Author

raed667 commented Nov 13, 2017

up?

@Brocco
Copy link
Contributor

Brocco commented Nov 14, 2017

Duplicate of #4419

@Brocco Brocco marked this as a duplicate of #4419 Nov 14, 2017
@Brocco Brocco closed this as completed Nov 14, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants