Skip to content

Instantly share code, notes, and snippets.

@fokusferit
Created April 8, 2016 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fokusferit/6e7b3c315ec4012ac3c3402ee2c0b707 to your computer and use it in GitHub Desktop.
Save fokusferit/6e7b3c315ec4012ac3c3402ee2c0b707 to your computer and use it in GitHub Desktop.
<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