Skip to content

Instantly share code, notes, and snippets.

@windlessuser
Last active August 29, 2015 14:15
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 windlessuser/465fd1e7a8a36e7dbc9b to your computer and use it in GitHub Desktop.
Save windlessuser/465fd1e7a8a36e7dbc9b to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../core-ajax/core-ajax.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
}
#core_ajax {
left: 300px;
top: 170px;
position: absolute;
}
</style>
<core-ajax url="https://shipstream-server.herokuapp.com/customers" handleas="json" response="{{ response }}" loading method="GET" id="ajaxtest" on-core-response="{{ handle }}" hidden></core-ajax>
<div id="result"></div>
<button id="button" on-click="{{get}}">Press Me</button>
</template>
<script>
Polymer({
handle: function () {
console.log(this.$.ajaxtest.response);
this.$.result.innerHTML = JSON.stringify(this.response);
},
response: null,
get: function(){
this.$.ajaxtest.go();
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment