如何将Angular组件内部的外部可视库(DHTMLX Gantt)触发的“ onclick”事件与该Angular组件的功能绑定在一起?
环境:
Component.html
<div #gantt_here style='width: 100%; height: 100%;'></div>
Component.ts
export class ProjectManagementGanttComponent implements OnInit {
@ViewChild('gantt_here') ganttContainer: ElementRef;
constructor() {
}
ngOnInit() {
// Config Gantt Library
gantt.config.columns = [
{name: 'tree', width: 30,
template: '<input type=button onclick=expand_task(' + task.id + ') value=+>'
},
{name: 'text', label: 'Task name', width: '*'}
];
// Init Gantt Library
gantt.init(this.ganttContainer.nativeElement);
}