mardi 13 septembre 2016

Polymer inline conditional, or, how do I display a loading image?

If I wanted to display a loading image and I was using JQuery to populate my data, I would do something like this:

HTML

<div id="loadthis"><img src="loading.gif"></div>

JS

$('#loadthis').html("Received Data");

However, with Polymer, my template looks like this:

<div id="loadthis"></div>    

and I have this property:

Polymer({
    is: 'test-loading',
    properties: {
        receiveddata: {
            type: String,
            value: ''
        }
    }
});

I have tried simply putting html in the value for receiveddata but quickly discovered that won't work. I've also tried moustache syntax of etc, but that didn't work at all.

How can I display an image until the receiveddata property is populated?

Aucun commentaire:

Enregistrer un commentaire