You can also add listeners procedurally.

<pre style="font-size: 14pt">
this.getReference('mycomp').addListener(string, function);
</pre>

The string is the name of the event, the function is the callback function.

The callback function could be an in-line function, or a reference to a function.


<pre style="font-size: 14pt">
this.getReference('mycomp').addListener('change', data=>console.log(data));
</pre>



<pre style="font-size: 14pt">
this.getReference('mycomp').addListener('change', this.onChange.bind(this));
</pre>