Skip to content

Environment variables on index.html #6778

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
aldo-roman opened this issue Jun 22, 2017 · 4 comments
Closed

Environment variables on index.html #6778

aldo-roman opened this issue Jun 22, 2017 · 4 comments

Comments

@aldo-roman
Copy link

Bug Report or Feature Request (mark with an x)

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

Versions.

1.1.0

Repro steps.

  1. go to index.html
  2. include this code:
<script>
console.log(environment.production);
</script>

Desired functionality.

I would like to access environment files in inline javascript code, ie <script>...</script>

Mention any other details that might be useful.

Motivation we need to setup some tracking IDs (think Google Analytics) and do not know how to replace them at compile time while doing production release.

@jgodi
Copy link

jgodi commented Jun 24, 2017

Answered in #4451. Hope that helps!

@filipesilva
Copy link
Contributor

Closing as a (sort of) duplicate of #4451, answered in #4451 (comment).

@toby5box
Copy link

toby5box commented Jul 2, 2019

Better answer at #4451 (comment)

@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 9, 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

4 participants