I am trying to make a request using iron-ajax.
My code looks like this:
<link rel="import" href="../bower_components/iron-ajax/iron-ajax.html">
<iron-ajax
id="fetch"
url="myapi.com/resource"
method="GET"
content-type="application/json"
handle-as="json"
on-response="storeData"
debounce-duration="300" auto>
</iron-ajax>
I consistently get this error and have linked to the source below.
Uncaught TypeError: request.completes.then is not a function
https://github.com/PolymerElements/iron-ajax/blob/master/iron-ajax.html#L447
When I log the spawned iron-request
object request.completes
out to my console, I see the below object.
g
_callbacks: Object
_pendingCallbacks: Object
ctx: null
promiser: ()
__proto__ : Object
I am using the following versions, and polymer serve
to run the app locally.
iron-ajax: 1.4.3 polymer: 1.7
storeData
? Also, try to provide a minimal (non)working example. – alescstoreData: function(response) { console.log(response) }
– Mike Spangleriron-request
is unresolved (e.g., it's not defined). Do you have a GitHub link or fiddle that reproduces the problem? – tony19generateRequest()
method on a given iron-ajax id, to generate the request whenever an event handler is fired (like selected change). – Kaung Myat Lwinrequest.completes
above appears to be a valid promise AFAIK. The setter for request.completes here: github.com/PolymerElements/iron-ajax/blob/master/… – Mike Spangler