Plotly event : possibilities in the on. method

Hello everyone,

I’d like to do routing using the plotly events. For exemple, I’m using a map and if we click on a state of a country, I’d like to go in the page of this state. I’m using plotly with Angular.js. But it seems that I do not have access to the properties of my angular component in the .on method. Do you know if plotly offers the possibility to do this kind of action ?

 Plotly.newPlot('myDiv', data, layout);
 myPlot.on('plotly_click', function(data){
    this.router.navigate(['eco']) ;
 }) ;

Cheers,