Angular Custom Editor Example has errors

Tags: #<Tag:0x00007f8b1df6c048>

The example on the documentation page for Angular editors will not compile. The specific issue is with
constructor(props) { super(props) }

Typescript is expecting a binding of Handsontable. Simply putting props there throws an error while compiling. Expected 6 arguments, but got 1. Is there something that I’m missing?

I’ve never came across super(props) with Angular. I’ve created an issue on git hub but I’m hoping to expedite this process.

Hi,

It looks like a mistake. Constructor with only super call and exactly the same arguments is not needed at all.

My guess would be that the idea was to use rest and spread operators:

constructor(...props) {
   super(...props);
}

Just in case you wanted to do something else in the constructor.

Kind Regards
Wojciech

I agree it was a mistake. I could have omitted the constructor however I was binding additional data to the editor.
My work around was to go with what typescript was asking for and add the individual props to the constructor.
constructor( boundDataForThisEditior: any, instance: Handsontable, row: number, col: number, prop: string, TD: HTMLTableDataCellElement, cellProperties: Handsontable.CellProperties, ) { super(instance, row, col, prop, TD, cellProperties); }

Angular still complains about the spread, which is weird, but likely a TypeScript issue.

My suggestion is to use the above example in the documents example