Skip to content

Instantly share code, notes, and snippets.

@azza85
Created September 18, 2014 00:27
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 azza85/1e76d859c8bd52ab55bd to your computer and use it in GitHub Desktop.
Save azza85/1e76d859c8bd52ab55bd 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: 1190px;
top: 380px;
position: absolute;
}
</style>
<core-ajax auto url="http://gdata.youtube.com/feeds/api/videos/"
params='{"alt":"json", "q":"chrome"}'
handleAs="json"></core-ajax>
<template repeat="{{response.feed.entry}}">
<div>{{title.$t}}</div>
</template>
<script>
Polymer('my-element', {
document.addEventListener('polymer-ready', function() {
var ajax = document.querySelector("core-ajax");
ajax.addEventListener("core-response",
function(e) {
document.querySelector('template').model = {
response: e.detail.response
};
}
);
});
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment