Created
September 22, 2015 17:36
-
-
Save duongphuhiep/000dcf94953f611da210 to your computer and use it in GitHub Desktop.
iron-ajax element basic usage
This file contains 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
<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