I am currently facing an issue with scoping in my component click event. Specifically, I need to access private variables within the component, but the keyword this
now refers to the event scope rather than the component's. This has led to an error where this.arr
is undefined within the event.
onclick(event){
for(var i = 0; i < this.arr.length; i++) { ... }
}
Given the scenario above, how can I regain access to the component's scope from within the event function?