Skip to content

Commit

Permalink
use environment variables defined on window
Browse files Browse the repository at this point in the history
  • Loading branch information
Gene Connolly committed Dec 5, 2018
1 parent 9fc12b9 commit bb70757
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Component } from '@angular/core';
import { environment } from '../environments/environment';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'netlify-env';
title = environment.title;
}
4 changes: 1 addition & 3 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export const environment = {
production: true
};
export const environment = (window as any).env;
3 changes: 2 additions & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// The list of file replacements can be found in `angular.json`.

export const environment = {
production: false
production: false,
title: 'netlify-env'
};

/*
Expand Down

0 comments on commit bb70757

Please sign in to comment.