Skip to content

Commit

Permalink
feat(environment): show current environment name next to version (bes…
Browse files Browse the repository at this point in the history
…ides prod)
  • Loading branch information
tomastrajan committed Oct 10, 2017
1 parent 196d18f commit 3322b41
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 1 deletion.
Empty file modified CHANGELOG.md
100755 → 100644
Empty file.
Empty file modified package.json
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<a matTooltip="Show changelog"
matTooltipPosition="before"
href="https://github.com/tomastrajan/angular-ngrx-material-starter/blob/master/CHANGELOG.md">
<i class="fa fa-rocket"></i> {{version}}
<i class="fa fa-rocket"></i> {{version}} <span *ngIf="!isProd">[{{envName}}]</span>
</a>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class AppComponent implements OnInit, OnDestroy {

@HostBinding('class') componentCssClass;

isProd = env.production;
envName = env.envName;
version = env.versions.app;
year = new Date().getFullYear();
logo = require('../assets/logo.png');
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const packageJson = require('../../package.json');

export const environment = {
envName: 'PROD',
production: true,
versions: {
app: packageJson.version,
Expand Down
1 change: 1 addition & 0 deletions src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const packageJson = require('../../package.json');

export const environment = {
envName: 'DEV',
production: false,
versions: {
app: packageJson.version,
Expand Down

0 comments on commit 3322b41

Please sign in to comment.