From f84ba10bd3c038d39d5d11716474da0c7e4ffd33 Mon Sep 17 00:00:00 2001 From: Sean Landsman Date: Mon, 2 Oct 2017 16:26:03 +0100 Subject: [PATCH] Testing fw for 13.3.0 --- src/aureliaFrameworkComponentWrapper.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/aureliaFrameworkComponentWrapper.ts b/src/aureliaFrameworkComponentWrapper.ts index e98d05f..ea90bf0 100644 --- a/src/aureliaFrameworkComponentWrapper.ts +++ b/src/aureliaFrameworkComponentWrapper.ts @@ -57,7 +57,6 @@ abstract class BaseGuiComponent { private _viewCompiler: ViewCompiler; protected _params: any; - protected _frameworkComponentInstance: any; // the users component - for accessing methods they create protected _view: View; constructor(taskQueue: TaskQueue, viewCompiler: ViewCompiler) { @@ -102,7 +101,19 @@ abstract class BaseGuiComponent { } public getFrameworkComponentInstance(): any { - return this._frameworkComponentInstance; + let controllers: any[] = ( this._view).controllers; + + //only one controller is allowed in editor template + if (controllers && + controllers.length == 1 && + controllers[0].viewModel) { + let editorVm = controllers[0].viewModel; + //this is a 'hack' because we don't have params.bind="" in the template + //must reset params or it will be nothing + editorVm.params = this._params; + return editorVm; + } + return null; } }