I have some Polymer elements that are not inside an element/app, and I can't figure out how to attach their event handlers, such as on-click, to a global javascript function.
For example, let's say my code looks something like this
<head>
// Import stuff...
function login(){
// Do stuff
}
</head>
<body unresolved>
<dom-if id="signInItem">
<template>
<paper-button on-tap="login"><iron-icon icon="icons:account-circle"></iron-icon> Log in</paper-button>
</template>
</dom-if>
</body>
This won't work, because on-tap expects to bind to a property of an enclosing element (I guess). What are my options?
give some id for paper-button
in javascript you can add eventlistener as shown below
or you can write your code in seperate function