| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <!-- |
| 3 @license |
| 4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 5 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 6 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 7 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 8 Code distributed by Google as part of the polymer project is also |
| 9 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 10 --> |
| 11 <html> |
| 12 <head> |
| 13 <title>iron-signals demo</title> |
| 14 |
| 15 <meta charset="utf-8"> |
| 16 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 17 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initia
l-scale=1, user-scalable=yes"> |
| 18 |
| 19 <script src="../../webcomponentsjs/webcomponents-lite.js"></script> |
| 20 |
| 21 <link rel="import" href="../../paper-styles/paper-styles.html"> |
| 22 <link rel="import" href="../../paper-styles/demo-pages.html"> |
| 23 <link rel="import" href="../iron-signals.html"> |
| 24 </head> |
| 25 <body> |
| 26 |
| 27 <div class="vertical-section vertical-section-container centered"> |
| 28 |
| 29 <h1><iron-signal></h1> |
| 30 <template is="dom-bind" id="my-app"> |
| 31 <iron-signals on-iron-signal-foo="fooSignal"></iron-signals> |
| 32 </template> |
| 33 |
| 34 <template is="dom-bind" id="signal-message"> |
| 35 <template is="dom-if" if="{{detail}}"> |
| 36 <div><code>my-app</code> got a <code>{{detail}}</code> signal</div> |
| 37 </template> |
| 38 </template> |
| 39 |
| 40 </div> |
| 41 |
| 42 <script> |
| 43 |
| 44 document.addEventListener("WebComponentsReady", function() { |
| 45 document.querySelector('#my-app').fire('iron-signal', {name: "foo", data:
"Foo!"}); |
| 46 }); |
| 47 |
| 48 document.querySelector("#my-app").fooSignal = function(e, detail, sender) { |
| 49 document.querySelector("#signal-message").detail = detail; |
| 50 }; |
| 51 </script> |
| 52 |
| 53 </body> |
| 54 </html> |
| OLD | NEW |