Как связать событие «onclick», запускаемое из внешней визуальной библиотеки (DHTMLX Gantt) внутри компонента Angular с функцией того же компонента Angular?
Среда:
- Приложение Angular 6
- Внешняя визуальная библиотека JavaScript (DHTMLX Gantt)
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);
}