Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
  <base href="http://polygit.org/components/">
  <script src="webcomponentsjs/webcomponents-lite.min.js"></script>
  <link href="polymer/polymer.html" rel="import">
  <link rel="import" href="paper-button/paper-button.html">
</head>
<body>
  <template is="dom-bind" id="app">
    <span>[[name]]</span>
    <template is="dom-repeat" items="[[items]]">
      <paper-button on-tap="_handleTap" data-item$="[[item]]">Button</paper-button>
    </template>
  </template>
  <script>
    var app = document.querySelector('#app');
    app.name = 'world';
    app.items = [
      {name: 'hello'},
      {name: 'game'},
      {name: 'over'}
    ];
    app._handleTap = function(e) {
     var item = JSON.parse(Polymer.dom(e).localTarget.dataset.item);
      app.name = item.name;
    };
  </script>
</body>
</html>
Output

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

Dismiss x
public
Bin info
travellhynepro
0viewers