Skip to content

Instantly share code, notes, and snippets.

@fokusferit
Created April 8, 2016 08:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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