Struggling with implementing Polymer's <dom-repeat>
.
Working with parent objects (folders) and child objects (contents within the folders) that are both generated from AJAX responses.
The desired output should look like this:
Folder
- child
- child
- child
Here's the code snippet:
<iron-ajax id="folder" url="../Folder" auto last-response="{{folders}}"></iron-ajax>
<template is="dom-repeat" items="{{folders.items}}" as="folder">
<paper-card on-tap="openFolder" object item="[[folder]]">
<custom-object value="[[folder]]" link></custom-object>
<iron-ajax id="folder" url="..[[folder.id]]/children" auto last-response="{{children}}"></iron-ajax>
<template is="dom-repeat" items="{{children.items}}" as="children">
<custom-object style="margin-top: 15px" value="[[children]]" link></custom-object>
</template>
</paper-card>
</template>
Encountering the issue where each folder ends up becoming a child of the last folder instead of maintaining its own parent-child relationship.