Skip to content

Instantly share code, notes, and snippets.

@duongphuhiep
Created September 22, 2015 17:36
Show Gist options
  • Save duongphuhiep/000dcf94953f611da210 to your computer and use it in GitHub Desktop.
Save duongphuhiep/000dcf94953f611da210 to your computer and use it in GitHub Desktop.
iron-ajax element basic usage
<dom-module id="post-collection">
<template>
<iron-ajax
auto
method="POST",
url="/backend/admin.php"
body='{"ignoreTemp":"true"}'
handle-as="json"
last-response="{{postsCollection}}"
on-response="handleResponse"
debounce-duration="200"></iron-ajax>
</template>
<script>
Polymer({
handleResponse: function(e) {
console.log("response: ", e.detail.response);
console.log("response: ", e.target.lastResponse);
}
});
</script>
</dom-module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment