title: Error defining function in Polymer 2.0
body: <p>I want to toggle the <code>paper-drawer</code> by clicking the menu button in the upper left of the toolbar. The problem is I get the following error in the console:</p>
  
  <blockquote>
    <p>"ReferenceError: _toggle is not defined
        at HTMLElement.onclick (<a href="http://null.jsbin.com/runner:1:1805" rel="nofollow noreferrer">http://null.jsbin.com/runner:1:1805</a>)"</p>
  </blockquote>
  
  <p><a href="http://jsbin.com/degifisici/1/edit?html,console,output" rel="nofollow noreferrer">Here is the JSBin Demo</a>.</p>
  
  <a href="http://jsbin.com/degifisici/1/edit?html,console,output" rel="nofollow noreferrer">http://jsbin.com/degifisici/1/edit?html,console,output</a>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;meta name="viewport" content="width=device-width"&gt;
    &lt;title&gt;JS Bin&lt;/title&gt;
  
    &lt;base href="http://polygit.org/polymer+:master/components/"&gt;
    &lt;script src="webcomponentsjs/webcomponents-lite.js"&gt;&lt;/script&gt;
    &lt;link rel="import" href="polymer/polymer-element.html"&gt;
    &lt;link rel="import" href="app-layout/app-layout.html"&gt;
    &lt;link rel="import" href="iron-icons/iron-icons.html"&gt;
    &lt;link rel="import" href="iron-icon/iron-icon.html"&gt;
    &lt;link rel="import" href="paper-item/paper-icon-item.html"&gt;
    &lt;link rel="import" href="paper-icon-button/paper-icon-button.html"&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
    &lt;dom-module id="my-el"&gt;
      &lt;template&gt;
        &lt;app-header reveals&gt;
          &lt;app-toolbar&gt;
            &lt;paper-icon-button icon="menu" onclick="_toggle"&gt;&lt;/paper-icon-button&gt;
            &lt;div main-title&gt;My app&lt;/div&gt;
            &lt;paper-icon-button icon="delete"&gt;&lt;/paper-icon-button&gt;
            &lt;paper-icon-button icon="search"&gt;&lt;/paper-icon-button&gt;
            &lt;paper-icon-button icon="close"&gt;&lt;/paper-icon-button&gt;
            &lt;paper-progress value="10" indeterminate bottom-item&gt;&lt;/paper-progress&gt;
          &lt;/app-toolbar&gt;
        &lt;/app-header&gt;
        &lt;app-drawer id="drawer" swipe-open&gt;&lt;/app-drawer&gt;
      &lt;/template&gt;
      &lt;script&gt;
        class MyEl extends Polymer.Element {
          static get is() { return 'my-el' }
  
          constructor() {
            super();
          }
  
          ready() {
            super.ready();
          }
  
          _toggle() {
            var drawer = this.$.drawer;
            drawer.toggle();
          }
  
        }
        customElements.define(MyEl.is, MyEl);
      &lt;/script&gt;
    &lt;/dom-module&gt;
  
    &lt;my-el&gt;&lt;/my-el&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>