chore(r5): dependencies update, couple of fixes

This commit is contained in:
nixa 2016-08-30 13:44:04 +03:00
parent 44fe93a0c6
commit 98097f5e27
18 changed files with 138 additions and 115 deletions

View file

@ -51,20 +51,21 @@ const APP_PROVIDERS = [
export class AppModule {
constructor(public appRef: ApplicationRef, public appState: AppState) {
}
hmrOnInit(store) {
if (!store && !store.state) return;
if (!store || !store.state) return;
console.log('HMR store', store);
this.appState.state = store.state;
this.appState._state = store.state;
this.appRef.tick();
delete store.state;
}
hmrOnDestroy(store) {
let cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement);
const cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement);
// recreate elements
let state = this.appState.state;
const state = this.appState._state;
store.state = state;
store.disposeOldHosts = createNewHosts(cmpLocation);
// remove styles