0
我想使用鐵阿賈克斯提出請求。聚合物鐵阿賈克斯/鐵要求不會發射
我的代碼如下所示:
<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>
我一直得到這個錯誤,並已鏈接到下面的源。
Uncaught TypeError: request.completes.then is not a function
https://github.com/PolymerElements/iron-ajax/blob/master/iron-ajax.html#L447
當我登錄的催生iron-request
對象request.completes
出我的控制檯,我看到下面的對象。
g
_callbacks: Object
_pendingCallbacks: Object
ctx: null
promiser:()
__proto__ : Object
我使用的是以下版本,並polymer serve
在本地運行的應用程序。
鐵AJAX:1.4.3 聚合物:1.7
是什麼你的事件處理程序的內容,即'storeData'?同樣,儘量提供一個最小(非)的工作示例 – alesc
謝謝,@alesc。即使storeData只是'storeData:function(response){ console.log(response) }' –
這個錯誤似乎表明'iron-request'沒有被解析(例如,它沒有被定義)。你有GitHub鏈接或小提琴重現了這個問題嗎? – tony19