Skip to content

Instantly share code, notes, and snippets.

@t-palmer
Created February 27, 2018 03:46
Show Gist options
  • Save t-palmer/c42a3bafed02729f159ed640b5cb50c9 to your computer and use it in GitHub Desktop.
Save t-palmer/c42a3bafed02729f159ed640b5cb50c9 to your computer and use it in GitHub Desktop.
Displaying environment JSON in a component
import { Component } from '@angular/core';
import { environment } from '../environments/environment';
@Component({
selector: 'app-root',
template: `
<h1>
ng-configuration
</h1>
{{config | json}}
`,
styles: []
})
export class AppComponent {
config = environment;
}
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
production: false,
appconfig: {
serviceParmeter: 'Development URL',
moduleParamter: 'Development configuration information'
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment