I'm trying to learn how to work with the Aurelia framework. In doing so, I was reading the documentation here regarding their method of binding events. The documentation suggests using delegate by default. I have forked the plunkr that they provided in one of their blog posts and added a little bit to it. The full plunk is here.
app.html
<template>
<input value.bind="pageInput" blur.delegate="showAlert()" placeholder="delegate()" />
<input value.bind="pageInput" blur.trigger="showAlert()" placeholder="trigger()" />
<button type="button" click.delegate="showAlert()">delegate()</button>
<button type="button" click.trigger="showAlert()">trigger()</button>
</template>
app.js
export class App {
showAlert() {
alert('showAlert()');
}
}
As you can see in the plunkr, the blur.trigger/click.delegate/click.trigger all fire the event, but blur.delegate doesn't.
Why is this the case?
How can you determine when .delegate
isn't going to work(without manually testing it of course)?