Hi there,
I have a diagram - that renders fine and have set up the (click) handler as follows:
<ejs-diagram
#diagram
id="diagram"
width="100%"
height="580px"
[getConnectorDefaults]="connDefaults"
[getNodeDefaults]="nodeDefaults"
[tool]="tool"
[layout]="layout"
[dataSourceSettings]="data"
[snapSettings]="snapSettings"
(created)="created()"
(click)="handleClick($event)"
></ejs-diagram>
My event handler looks like this:
handleClick(args: IClickEventArgs): void {
console.log(args);
if (args.element instanceof Node) {
console.log('We got a Node');
}
}
When I look at the output of the console.log I can see that the type of the element is Node. However, the if statement is never true. Instead it shows that it is type object. Why would this be please?