Home › forums › Using CanvasJS › Event handling on data click fails
This topic contains 3 replies, has 2 voices, and was last updated by Manoj Mohan 3 weeks ago.
I’m able to get details from data points via event handling when I have static data. If I use the same way to get details with data called from service(Angular), I’m getting the following error – Error: g[e[f]].call is not a function.
Error: g[e[f]].call is not a function
Here’s the working example I’m using – https://stackblitz.com/edit/test-function-binding
The issue seems to be with the binding of click-event handler. onClick that’s being assigned to click event in sample.data.ts file is undefined. Please take a look at this updated sample.
Thank you so much. It’s working now.
Also, I have one more doubt. The data that we are fetching in event handling function is not getting reflected in UI though it’s getting updated in console. Is this related to Canvas or some issue with Angular? I have updated the code
The issue seems to be with the context of “this” used in the onClick function. Please take a look at this updated sample.
You must be logged in to reply to this topic.