I am making a modal to add data to a json file and display it in the DOM. The data is saved to the file, but the DOM is not updated. I'm using iron-ajax.
<div>
<iron-ajax
auto
url="areas.json"
handle-as="json"
last-response="{{response}}"
on-response="responseHandler"
></iron-ajax>
<div class="modal"></div>
<div class="layout vertical">
<div class="layout horizontal">
<template class="" id="esquema" is="dom-repeat" items="{{response}}" as="item">
<div class$="iron-flex {{item.type}}">{{item.name}}</div>
</template>
</div>
</div>
</div>
I did not put the modal code, but it does work to save and call the function:
addData: function(){
var selectedItem = this.options[this.selectedIndex];
nuevo.push({"name": this.$.numberArea.value,
"level": "1",
"type": selectedItem.area});
this.$.numberArea.value = null;
this.$.areaSelect.selected = null;
},
Attempt that in that function update the id="esquema". I make this.$.esquema.render(), but it does not work.
I would greatly appreciate your help