-
Notifications
You must be signed in to change notification settings - Fork 23
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
docs(build): documented environment support #436
docs(build): documented environment support #436
Conversation
After a check with @christophercr , it seems that we don't actually have any way to know which environment is used in the app, I'll try to implement that with @SuperITMan |
31af969
to
185fe24
Compare
docs/ENVIRONMENTS.md
Outdated
|
||
All you have to do is to import in your app.module.ts file the environment.ts constant | ||
``` | ||
import { environment } from "../environments/environment"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the import can be
import { environment } from "environments/environment";
Which is easier to use 😊
docs/ENVIRONMENTS.md
Outdated
|
||
## How to find out which environment is your application is currently using? | ||
|
||
All you have to do is to import in your app.module.ts file the environment.ts constant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can import the environment everywhere in your application, not only in the app.module.ts
docs/ENVIRONMENTS.md
Outdated
You can add as many environments as you want, as long as you define their options and file replacement in `angular.json`: | ||
and you add the actual needed file in `src/environments`: | ||
|
||
If you do add an environment, don't forget to adapt as well the `src/environments/model.ts` file and to add your own env. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you mean is actually a new property in the enviroment object right?
docs/ENVIRONMENTS.md
Outdated
## How to add a new environment? | ||
|
||
You can add as many environments as you want, as long as you define their options and file replacement in `angular.json`: | ||
and you add the actual needed file in `src/environments`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @SuperITMan we should provide our own Environment interface which they should extend in case they want to add new environments, otherwise they might change all the interface and break the Stark code because we are relying in that interface
185fe24
to
a4abfc7
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
No documentation existed about the way to find out the current environment within Stark applications.
What is the new behavior?
Documentation has been added to help developers.
Does this PR introduce a breaking change?