Last active
August 29, 2015 14:17
-
-
Save cdata/a01ceab25490595172f0 to your computer and use it in GitHub Desktop.
Binding example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link rel="import" href="../polymer/polymer.html"> | |
| <link rel="import" href="../core-ajax/core-ajax.html"> | |
| <dom-module id="x-ajax-text"> | |
| <!-- We bind the core-ajax `lastResponse` to the `content` property. This | |
| property is not actually published by `x-ajax-text`, but because it is | |
| specified in the template it will be bindable elsewhere in the template --> | |
| <core-ajax id="ajax" url="./content.txt" last-response="{{content}}" auto></core-ajax> | |
| <!-- Here we bind `content` in another place, which will be effectively | |
| equivalent to binding `this.$.ajax.lastResponse`. --> | |
| <p>[[content]]</p> | |
| </dom-module> | |
| <script> | |
| Polymer({ | |
| is: 'x-ajax-text' | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment