Skip to content

Instantly share code, notes, and snippets.

@ryanisinallofus
Created September 18, 2014 22:17
Show Gist options
  • Save ryanisinallofus/963d2ce21e4a394e6cae to your computer and use it in GitHub Desktop.
Save ryanisinallofus/963d2ce21e4a394e6cae to your computer and use it in GitHub Desktop.
<link rel="import" href="../../lib/core-ajax/core-ajax.html">
<polymer-element name="cxz-vehicle-menu" noscript>
<template>
<core-ajax auto url="{{url}}" handleAs="json" on-core-response="{{ajaxResponse}}"></core-ajax>
<h2>Vehicles</h2>
<template repeat="{{v in vehicles}}">
<li>{{v.year}} {{v.make}} {{v.model}}</li>
</template>
</template>
<script>
Polymer({
ajaxResponse: function(event, response) {
console.log(response);
this.response = response;
this.vehicles = response.response.vehicles;
},
things: [1, 2, 3],
url: '/service/get_vehicles?access_token=x234765734ssf343432t'
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment