Created
February 27, 2018 03:46
-
-
Save t-palmer/c42a3bafed02729f159ed640b5cb50c9 to your computer and use it in GitHub Desktop.
Displaying environment JSON in a component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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