Binding custom context menu with Angular Wrapper

we want to bind a custom context menu with Grid. We are using Angular Wrapper with HandsonPro 1.14.0 with wrapper 1.0.0.beta2. I had gone through the blog below as well,

https://handsontable.com/blog/articles/customize-handsontable-context-menu

Tried the option as below, I could see the menu, but it is not functional:

@Input() contextMenu: any= {
    items: [{
        key: "delete",
        name: 'Remove Table',
        callback: function(key, options){console.log("remove table");this.onRemoveGrid.emit(true);}
    }]
};

Wanna to fire this this.onRemoveGrid.emit(true) on clicking the option “Remove Table”.

What is the right way to do this?

Found the proper way to bind custom functions with ContextMenu: Binding the callback with “fat arrow” provides the context of the holding angular component, so I could fire my own function.

contextMenu: any = {
items: [{
key: “delete”,
name: ‘Remove Table’,
callback: (key, options) => {
console.log(“call my function”,this); this.myOwnFunction();
}
}]
};

Hi @sumathi.vellaisamy

is there anything else I can do for you or we can close the issue?

We can close the isssue, I wish these things to be added in documentaion/examples.

We are planning to add a ‘How to’ tutorial base but it’s not finished yet. I hope that we’ll be able to share it soon.