I am now reading the angular4 doc, and noticed, there is one folder, environments, and under which, there are multiple environment files, such as environment.ts, environment
Assuming the environment.ts file exports, for example, a constant named environment, then first you import the constant (using the appropriate path):
import { environment } from '../environment';
Then in code you just use the constant:
let mything = environment.mything;