I've got an iron-list inside a paper-dialog I would like to fill with data from an AJAX-request. The response from the server looks like this:
[{"name":"Bob"},{"name":"Tim"},{"name":"Mike"}]
This is my custom Polymer component:
<link rel="import" href="../../bower_components/iron-list/iron-list.html">
<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
<link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
<dom-module id="my-dialog">
<template>
<iron-ajax id="getAjax" url="/getdata" handle-as="json" lastResponse="{{data}}" auto></iron-ajax>
<paper-dialog id="loadDialog">
<h2>Header</h2>
<iron-list items="[[data]]" as="item" style="height:200px">
<template>
<div>
Name: <span>[[item.name]]</span>
</div>
</template>
</iron-list>
</paper-dialog>
</template>
Why is the list staying empty?
lastResponse
must be renamed to last-response
.