Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <base href="//polygit.org/polymer+:master/components/">
  <script src="webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="polymer/polymer-element.html">
  <link rel="import" href="iron-selector/iron-selector.html">
</head>
<body>
  <dom-module id="my-el">
    <template>
      <iron-selector selected="[[route]]">
        <div>Item 1</div>
        <div>Item 2</div>
        <div>Item 3</div>
      </iron-selector>
    </template>
    <script>
      class MyEl extends Polymer.Element {
        static get is() { return 'my-el' }
        static get properties() { return {
          route: {
            type: Number,
            notify: true,
            observer: '_routeChanged',
          },
        }}
        
        constructor() {
          super();
        }
        _routeChanged(route) {
          console.log('route', route);
        }
      }
      customElements.define(MyEl.is, MyEl);
    </script>
  </dom-module>
  
  <my-el></my-el>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers