i have a following code inside angular directive, i wanted to access class level variable inside the call back function so i used the arrow function but the 'this' is still not pointing to directive.
this.itemRects.selectAll('rect')
.data(this.visItems, (d) => {
return d.id + this.x;
})
i added debugger at the return statement on the debugger it shows this pointing towards data array.
how can i access directive level 'this' inside callback function?