Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<link rel="import" href="https://cdn.rawgit.com/Download/polymer-cdn/master/lib/polymer/polymer.html" />
<link rel="import" href="https://cdn.rawgit.com/Download/polymer-cdn/master/lib/iron-ajax/iron-ajax.html" />
<dom-module id="ajax-element">
<template>
<iron-ajax
auto
url="https://jsonplaceholder.typicode.com/posts/1"
handle-as="json"
last-response="{{response}}"
id="xhr"></iron-ajax>
</template>
<script>
let url = "https://jsonplaceholder.typicode.com/posts/";
Polymer({
is: "ajax-element",
properties: {
response: {
type: String
}
}
});
</script>
</dom-module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment