paphonb
paphonb

Reputation: 83

Polymer 1.0 custom events

I was using this code on Polymer 0.5 but on Polymer 1.0 it's not working.

On child element:

this.fire('login-start', {
    username: this.username,
    password: this.password,
    me: this
});

On parent element (app-main.html):

<dom-module name="app-main" on-login-start="{{checkLogin}}">

And on app-main.js:

checkLogin: function() {
    alert("This is not working.");
}

How do I fire and catch custom events in Polymer 1.0?

Upvotes: 5

Views: 3466

Answers (1)

altfuns
altfuns

Reputation: 106

You should remove the double brackets ({{}}) from on-login-start.

<dom-module name="app-main" on-login-start="checkLogin">

Here is the documentation.

Upvotes: 9

Related Questions