Im trying to build an app with Cytoscape.js and Angular2+. The Core part take place in a single service (cy.service). I add all Eventlisteners in a single function and call it after the cy init.
eg:
initEventlisteners(){
cy.on('tap', this.handler);
cy.on(...);
...
}
handler(event: any){
console.log('something');
}
If I wrap console.log in a helper-function like that:
helper(){
console.log('something');
)
And use it in the handler-function
handler(event:any){
this.helper();
}
It calls: helper() is not a function. Thats a big problem that a cant use other functions inside the handler. Any ideas how to solve that problem ?