This question will sound a bit odd, but I will explain the reason. I am using d3.js combined with Angular. everything is fine, but sometimes there are events within the logic of d3.js in which "this" is a different value from the context of angular. For this reason I would like to know if there is a way to directly access the variables that I have defined in my component in the style of:
HomeComponent.myVar //HomeComponent name of my current component
Instead of
this.myvar
this is a example of my problem using d3.js
Node.on("mouseout", unfocus);
function unfocus(){
console.log(this); //problem context angular
}
Node.mouseover(function(d){
console.log(this); //this is not context angular, is a value of this event
console.log(HomeComponent.myvar); //not works, but is my idea
})
thank you.