-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix
Description
OS?
OSX El Capitan
Versions.
angular-cli: 1.0.0-beta.17
node: 6.7.0
os: darwin x64
Repro steps.
-- create a new app with ng new
-- in src/app/app.module.ts
import { environment } from '../environments/environment';
-- then in the NgModule add
@NgModule({
imports: [
...
],
declarations: [
...
],
providers: [{ provide: AppConfig, useValue: environment }],
bootstrap: [AppComponent]
})
export class AppModule { }
-- run ng build --prod --aot
If you inject AppConfig into a component or service you will get the incorrect environment.
I am pretty sure aot is breaking the environment switching. when statically analyzing the app module aot pulls in the initial config if passing it to module. The only way I have managed to work around is to copy the file with a script before build.
bmayen, antonmoiseev, musatov, Artishog, dabele91 and 4 more
Metadata
Metadata
Assignees
Labels
P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfulImpacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix