fix(angular): router-outlet memory leak

fixes #16285
This commit is contained in:
Manu Mtz.-Almeida
2018-12-19 00:43:45 +01:00
committed by Manu MA
parent d1cecf142b
commit 2c41823676
4 changed files with 15 additions and 13 deletions

View File

@ -76,6 +76,7 @@ export function destroyView(view: RouteView | undefined) {
if (view) {
// TODO lifecycle event
view.ref.destroy();
view.unlistenEvents();
}
}
@ -86,4 +87,5 @@ export interface RouteView {
element: HTMLElement;
ref: ComponentRef<any>;
savedData?: any;
unlistenEvents: () => void;
}