| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 @license | |
| 3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | |
| 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | |
| 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | |
| 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | |
| 7 Code distributed by Google as part of the polymer project is also | |
| 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | |
| 9 --><!-- | |
| 10 | |
| 11 **THIS ELEMENT IS EXPERIMENTAL. API AND NAME SUBJECT TO CHANGE.** | |
| 12 | |
| 13 Polymer's binding features are only available within templates that are managed | |
| 14 by Polymer. As such, these features are available in templates used to define | |
| 15 Polymer elements, for example, but not for elements placed directly in the main | |
| 16 document. | |
| 17 | |
| 18 In order to use Polymer bindings without defining a new custom element, elements | |
| 19 utilizing bindings may be wrapped with the `x-autobind` template extension. | |
| 20 This template will immediately stamp itself into the main document and bind | |
| 21 elements to the template itself as the binding scope. | |
| 22 | |
| 23 ```html | |
| 24 <!doctype html> | |
| 25 <html> | |
| 26 <head> | |
| 27 <meta charset="utf-8"> | |
| 28 <script src="components/webcomponentsjs/webcomponents-lite.js"></script> | |
| 29 <link rel="import" href="components/polymer/polymer.html"> | |
| 30 <link rel="import" href="components/core-ajax/core-ajax.html"> | |
| 31 | |
| 32 </head> | |
| 33 <body> | |
| 34 | |
| 35 <template is="x-autobind"> | |
| 36 | |
| 37 <core-ajax url="http://..." lastresponse="{{data}}"></core-ajax> | |
| 38 | |
| 39 <template is="x-repeat" items="{{data}}"> | |
| 40 <div><span>{{item.first}}</span> <span>{{item.last}}</span></div> | |
| 41 </template> | |
| 42 | |
| 43 </template> | |
| 44 | |
| 45 </body> | |
| 46 </html> | |
| 47 ``` | |
| 48 | |
| 49 --><html><head></head><body><script src="x-autobind-extracted.js"></script></bod
y></html> | |
| OLD | NEW |