title: Bind Polymer 2.x event handler to a global function?
body: <p>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 <code>on-click</code>, to a global javascript function.</p>
  
  <p>For example, let's say my code looks something like this </p>
  
  <pre><code>&lt;head&gt;
      // Import stuff...
  
      function login(){
          // Do stuff
      }
  &lt;/head&gt;
  &lt;body unresolved&gt;    
      &lt;dom-if id="signInItem"&gt;
          &lt;template&gt;
              &lt;paper-button on-tap="login"&gt;&lt;iron-icon icon="icons:account-circle"&gt;&lt;/iron-icon&gt; &amp;nbsp; Log in&lt;/paper-button&gt;
          &lt;/template&gt;
      &lt;/dom-if&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>This won't work, because <code>on-tap</code> expects to bind to a property of an enclosing element (I guess). What are my options?</p>