Here's the code snapshot:
class UIController {
constructor() {
let eleNodes = new EleNodes()
this.idsAndClasses = eleNodes.idsAndClasses
this.nodes = eleNodes.nodes
}
async OpenCloseForm() {
let formContainer = this.nodes.solcomForm
//...other code
}
}
When I, later-on, assign OpenCloseForm
as a function on click, this
does no longer reference che class this.nodes
but the context of this
becomes of the pressed button. Here the on click setup:
//this in this case references to the object setup in yet another class
//where I also call this event handler
this.uiCtrl.solcomForm.on("click", this.uiCtrl.OpenCloseForm)
Is there a way to reference back to the actual data within the class?
ps: I looked up already that question marked and it does lack the context which is in this case the use of class instead of functions, so I can't derive a solution from another context.