I am trying to call an angular method (this.showNodeDetails method) whenever I click a ContextMenu button but it seems for some reason I cannot access the angular method inside initDiagram(). Kindly help me on this. Here is a piece of code inside initDiagram.
dia.nodeTemplate =
$(go.Node, 'Spot',
{
contextMenu:
$('ContextMenu',
$('ContextMenuButton',
$(go.TextBlock, 'View Details'),
{
click: (e, obj) => {
const contextmenu = obj.part;
const nodedata = contextmenu.data;
*this.showNodeDetails(nodedata);*
}
}, new go.Binding('visible', '',
(o: any) => {
return o.diagram.selection.count === 1;
}).ofObject()
),