I have a button in my class. The button’s callback is supposed to call a method of the class buttonCB(), but I am getting an error on click
Uncaught TypeError: this.buttonCB is not a function
However, if my callback is a function, not a class’ method, I am getting the expected results
Can you please let me know what I am missing in the first example?
It might be related to my other post
This is because ‘this’ has changed; you should use arrow functions to avoid ‘this’ reference errors.