I am trying to use a function in one of my classes in a third party library(highcharts) I included in my project.
Something along the lines of:
export class TrendPage {
...
functionToUse(){
this.top = someCalculation();
}
...
this.chart = Highcharts.chart(this.chartContainer, {
...
xAxis: {
events: {
afterSetExtremes: ()=> {
this.functionToUse()
}
}
},
...
Is there a correct way to do this?
Solution I found:
Using ngZone to run the function outside the scope of the zone as in this answer Angular2 - how to call component function from outside the app