Skip to content
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

Merged

Conversation

Mallikki
Copy link
Contributor

@Mallikki Mallikki commented Jun 13, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

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?

[ ] Yes
[x] No

## Other information

@Mallikki Mallikki requested a review from SuperITMan June 13, 2018 08:21
@coveralls
Copy link

coveralls commented Jun 13, 2018

Coverage Status

Coverage decreased (-0.01%) to 94.247% when pulling a4abfc7 on Mallikki:feature/environments into 1c310b6 on NationalBankBelgium:master.

@Mallikki Mallikki closed this Jun 13, 2018
@Mallikki
Copy link
Contributor Author

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

@Mallikki Mallikki reopened this Jun 13, 2018
@dsebastien dsebastien added this to the 10.0.0-alpha.3 milestone Jun 13, 2018
@Mallikki Mallikki force-pushed the feature/environments branch from 31af969 to 185fe24 Compare June 14, 2018 07:57

All you have to do is to import in your app.module.ts file the environment.ts constant
```
import { environment } from "../environments/environment";
Copy link
Member

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 😊


## 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
Copy link
Member

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

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.
Copy link
Collaborator

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?

## 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`:
Copy link
Collaborator

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

@Mallikki Mallikki force-pushed the feature/environments branch from 185fe24 to a4abfc7 Compare June 18, 2018 08:39
@christophercr christophercr merged commit c7f3ff0 into NationalBankBelgium:master Jun 18, 2018
@Mallikki Mallikki deleted the feature/environments branch October 16, 2018 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants