Fix Dashboard Errors (#1106)

* fix ordering of component instance calls to fix erros

* add more verification methods
This commit is contained in:
Anthony Dresser
2018-04-10 13:46:07 -07:00
committed by GitHub
parent 5ac89e5a49
commit a327889d05
2 changed files with 7 additions and 3 deletions

View File

@@ -198,11 +198,11 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
let componentRef = this.componentHost.viewContainerRef.createComponent(componentFactory);
let componentInstance = componentRef.instance;
componentInstance.data = { columns: result.columnInfo.map(item => item.columnName), rows: result.rows.map(row => row.map(item => item.displayValue)) };
// check if the setter is defined
if (componentInstance.setConfig) {
componentInstance.setConfig(this.insightConfig.type[this._typeKey]);
}
componentInstance.data = { columns: result.columnInfo.map(item => item.columnName), rows: result.rows.map(row => row.map(item => item.displayValue)) };
if (componentInstance.init) {
componentInstance.init();