From f28e0c35f3528fe645107ab1ac9f8c4a6b0a852e Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Sat, 2 Apr 2016 12:54:47 -0500 Subject: [PATCH] fix(ng2.uiView): Dispose prev comp on empty viewconfig --- src/ng2/uiView.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ng2/uiView.ts b/src/ng2/uiView.ts index d30468492..1693f74cc 100755 --- a/src/ng2/uiView.ts +++ b/src/ng2/uiView.ts @@ -31,13 +31,13 @@ const getProviders = (injector) => { }` ], template: `
`, - // debugtemplate: ` + // template: ` //
// //
//
ui-view #{{uiViewData.id}} created by '{{ parentContext.name || "(root)" }}' state
//
name: (absolute) '{{uiViewData.fqn}}' (contextual) '{{uiViewData.name}}@{{parentContext.name}}'
- //
currently filled by: '{{(uiViewData.config && uiViewData.config.context) || 'empty...'}}'
+ //
currently filled by: '{{(uiViewData.config && uiViewData.config.viewDecl.$context) || 'empty...'}}'
//
// //
` @@ -90,7 +90,10 @@ export class UiView { } viewConfigUpdated(config: ViewConfig) { - if (!config) return; // TODO do something smarter + if (!config) { + return this.disposeLast(); + } + let {uiViewData, injector, dcl, elementRef} = this; let viewDecl = config.viewDecl;