Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Testing fw for 13.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlandsman committed Oct 2, 2017
1 parent a0c39f0 commit f84ba10
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/aureliaFrameworkComponentWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -102,7 +101,19 @@ abstract class BaseGuiComponent {
}

public getFrameworkComponentInstance(): any {
return this._frameworkComponentInstance;
let controllers: any[] = (<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;
}

}

0 comments on commit f84ba10

Please sign in to comment.