Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70817

How to call handler in a different context

$
0
0

In JavaScript (and other languages) “this” refers to the context in which a method is called. I am trying to bind an event handler to an object, but I cannot even compile the code, because the compiler assumes “this” refers to the component. And since it cannot find this.whateverProperty I refer to, defined on the component class, the build fails. To me, this is a failure of the compiler, since it cannot be known what “this” will refer to at compile time.

How do I get around this?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>