krispo / ng2-nvd3

Angular2 component for nvd3
http://krispo.github.io/ng2-nvd3/
MIT License
328 stars 104 forks source link

Access directive instance in dispatch events #52

Open gilhanan opened 8 years ago

gilhanan commented 8 years ago

Hi, We can get access to directive instance via @ViewChild and use it in angular life cycle events. But when I am trying access to the directive instance in dispatch.renderEnd event, I am getting other context of 'this', and can't getting access to the directive instance.

Any ideas?

Thanks!

gilhanan commented 8 years ago

Well using arrow function like that: dispatch: { renderEnd: () => {} }

allowed me access to component instance and consequently to ng2-nvd3 instance child

not sure if its good practice