Hi,
I am using dtmlx gantt with Angular 5 . I want call a angular function on same page when the task click event fires . Currently it was searching gantt.js not in .ts file of angular. Is there is way to call a angular function from gantt event .
gantt.attachEvent(“onTaskClick”, function(id,e){
//any custom logic here
this.test(); // Angular Function
return true;
});
The Error I was getting :
ERROR TypeError: this.test is not a function
** at DHXGantt. (viewLoader.component.ts:46)**
** at DHXGantt.z (dhtmlxgantt.js:27780)**
** at DHXGantt.obj.callEvent (dhtmlxgantt.js:27821)**
** at HTMLDivElement.onClick (dhtmlxgantt.js:21483)**
** at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421)**
** at Object.onInvokeTask (core.js:4062)**
** at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420)**
** at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188)**
** at ZoneTask.push…/node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:496)**
** at invokeTask (zone.js:1540)**
** at HTMLDivElement.globalZoneAwareCallback (zone.js:1566) E**