Skip to content

Instantly share code, notes, and snippets.

@cdata
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save cdata/a01ceab25490595172f0 to your computer and use it in GitHub Desktop.

Select an option

Save cdata/a01ceab25490595172f0 to your computer and use it in GitHub Desktop.
Binding example
<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