Reputation:
I try to make ajax with polymer iron-ajax.
My problem is that when Is their is some elements that can be render only after I received response, otherwise their is not data to render.
How can I "stop" the render of the element until their is response?
Thanks
Upvotes: 0
Views: 368
Reputation: 1009
Two options:
Add a conditional hidden
attribute to the div or elements you want hidden before the ajax call is completed:
<div hidden$="[[!response]]"></div>
or handle visibility using a computed binding
<div hidden$="[[_computeIsHidden(response)]]"
Wrap your content in a dom-if
template:
<template is="dom-if" if="[[_computeIsHidden(response)]]">
Upvotes: 0