Angular 如何从slickgrid中的自定义组件获取输出?
我在slickgrid中使用了ionic应用程序和自定义组件。我可以从slickgrid向我的组件提供输入。但我没有收到从我的组件到slickgrid的输出Angular 如何从slickgrid中的自定义组件获取输出?,angular,slickgrid,angular-slickgrid,Angular,Slickgrid,Angular Slickgrid,我在slickgrid中使用了ionic应用程序和自定义组件。我可以从slickgrid向我的组件提供输入。但我没有收到从我的组件到slickgrid的输出 renderAngularComponent(cellNode: HTMLElement, row: number, dataContext: any, colDef: Column) { if (colDef.params.component) { const componentOutput = this.ang
renderAngularComponent(cellNode: HTMLElement, row: number, dataContext: any, colDef: Column) {
if (colDef.params.component) {
const componentOutput = this.angularUtilService.createAngularComponent(colDef.params.component);
Object.assign(componentOutput.componentRef.instance, { selectedItem: dataContext, a: this.a, b: this.b });
setTimeout(() => $(cellNode).empty().html(componentOutput.domElement));
}
}
我通过这种方式在列定义中调用了上述方法
asyncPostRender: this.renderAngularComponent.bind(this)
这将为组件提供输入。请指导在slickgrid组件中接收输出或回调的方法。
componentOutput.componentRef.instance
保存组件实例,因此您只需手动附加输出属性,例如,如果存在save
componentOutput.componentRef.instance.save.subscribe(()=>{console.log("method called");
componentOutput.componentRef.instance
保存组件实例,因此您只需手动附加输出属性,例如,如果存在save
componentOutput.componentRef.instance.save.subscribe(()=>{console.log("method called");