Skip to content

Instantly share code, notes, and snippets.

@seangwright
Created August 18, 2018 03:05
Show Gist options
  • Save seangwright/b4fd913cebe3c85e10e61fdfedaf82a4 to your computer and use it in GitHub Desktop.
Save seangwright/b4fd913cebe3c85e10e61fdfedaf82a4 to your computer and use it in GitHub Desktop.
blog-best-way-to-use-angular-environment--environment.ts
/*
* In development mode, to ignore zone related error stack frames such as
* `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
* import the following file, but please comment it out in production mode
* because it will have performance impact when throw error
*/
import 'zone.js/dist/zone-error'; // Included with Angular CLI.
import { IEnvironment } from '@environments/ienvironment';
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
const apiHost = 'my-special-site.com';
const apiUrl = `http://${apiHost}/api`;
export const environment: IEnvironment = {
production: false,
enableDebugTools: true,
logLevel: 'debug',
apiHost,
apiUrl,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment