I have the following code
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/iron-ajax/iron-ajax.html" />
<dom-module id="custom-Element">
<iron-ajax auto
url="http://api.openweathermap.org/data/2.5/forecast"
params='{"q":"California"}'
handle-as="json"
on-response="handleResponse"
last-response="{{ajaxResponse}}"></iron-ajax>
<span>{{ajaxResponse.city.name}}</span>
<script>
Polymer({
is: 'custom-Element',
handleResponse: function ()
{
console.log(' blalba');
},
ready: function () {
setInterval(function () { console.log(this.ajaxResponse); }, 1000);
}
});
</script>
</dom-module>
My problem is even though the ajax call is happening and data is retrieved the on-response "handleResponse" method is never being fired and the "ajaxResponse" isn't being populated either. I tried looking at different tutorials and code demos but I can't seem to find what's wrong with my code.