I just updated to the latest angular-cli (beta 14) which now uses webpack instead of systemjs.
I used to be able to import constants from the config/environment{prod|dev}.ts
by simply importing it à la import { BASE_URL } from '../environment'
. This doesn't work any more.
Environments are now defined in angular-cli.json
and point to environments/environment{.prod}.ts
but how do I access them in my components?
Simply import in the environment.ts
file and at build time the appropriate environments file will be supplied based upon the environment (dev/prod)
import { environment } from '../environments/environment';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With