diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 16:24:31 +0200 |
commit | 0491173a61aed66205c017e0d7e0503ea316c144 (patch) | |
tree | ce6621597505f9518cfdf0981977d097c63f9fad /client/src/hmr.ts | |
parent | 8704acf49efc770d73bf07c10468ed8c74d28a83 (diff) | |
parent | 6247b2057b792cea155a1abd9788c363ae7d2cc2 (diff) | |
download | PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.gz PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.zst PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.zip |
Merge branch 'develop' into cli-wrapper
Diffstat (limited to 'client/src/hmr.ts')
-rw-r--r-- | client/src/hmr.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/src/hmr.ts b/client/src/hmr.ts index 4d707a250..d5306a7a2 100644 --- a/client/src/hmr.ts +++ b/client/src/hmr.ts | |||
@@ -1,11 +1,19 @@ | |||
1 | import { NgModuleRef, ApplicationRef } from '@angular/core' | 1 | import { NgModuleRef, ApplicationRef } from '@angular/core' |
2 | import { createNewHosts } from '@angularclass/hmr' | 2 | import { createNewHosts } from '@angularclass/hmr' |
3 | import { enableDebugTools } from '@angular/platform-browser' | ||
3 | 4 | ||
4 | export const hmrBootstrap = (module: any, bootstrap: () => Promise<NgModuleRef<any>>) => { | 5 | export const hmrBootstrap = (module: any, bootstrap: () => Promise<NgModuleRef<any>>) => { |
5 | let ngModule: NgModuleRef<any> | 6 | let ngModule: NgModuleRef<any> |
6 | module.hot.accept() | 7 | module.hot.accept() |
7 | bootstrap() | 8 | bootstrap() |
8 | .then(mod => ngModule = mod) | 9 | .then(mod => { |
10 | ngModule = mod | ||
11 | |||
12 | const applicationRef = ngModule.injector.get(ApplicationRef); | ||
13 | const componentRef = applicationRef.components[ 0 ] | ||
14 | // allows to run `ng.profiler.timeChangeDetection();` | ||
15 | enableDebugTools(componentRef) | ||
16 | }) | ||
9 | module.hot.dispose(() => { | 17 | module.hot.dispose(() => { |
10 | const appRef: ApplicationRef = ngModule.injector.get(ApplicationRef) | 18 | const appRef: ApplicationRef = ngModule.injector.get(ApplicationRef) |
11 | const elements = appRef.components.map(c => c.location.nativeElement) | 19 | const elements = appRef.components.map(c => c.location.nativeElement) |