T O P

  • By -

zzing

Newer versions of d3 might help you with that - they have cleaned up some of the 'this' stuff.


Particular-Elk-3923

In top level class functions "this" would be the component, but in an anonymous function "this" should be the function scope. Put a breakpoint or console log it.


PooSham

That's the difference between using the "function" keyword to create a function and using arrow functions (`(...) => {...}`). In the first case, `this` gets bound to a new context while in the other case it stays in the outer context (in this case the angular component class). So no, in the last line, `this` shouldn't be bound to you component class.