1

Here is my html

<div id="setImgWrap">
<!-- Here append image will be show -->
</div>

and here i am appending from js

this.addedImages =  {
 imageURL : self.downloadURL  
};
this.$.setImgWrap.append('<iron-image src="' +[[this.addedImages.imageURL]] + '"></iron-image>');

I want to show all uploaded image on browser, but this is showing whole tag in side the double quotes. How to i can show multiple images ?

Intervalia
  • 10,248
  • 2
  • 30
  • 60
Abhay Sharma
  • 221
  • 1
  • 7
  • 24

1 Answers1

0

The format of one-way binding in polymer is [[varibale]]. But when you do like

<iron-image src="' +[[this.addedImages.imageURL]] + '"></iron-image>

that will be evaluated as there is no variable [[this.addedImages.imageURL]] of course it won't be a variable.

So, you must do this

<iron-image src="[[' +this.addedImages.imageURL+ ']]"></iron-image>

then the variable will be evaluated to image path i.e., "[[' +this.addedImages.imageURL+ ']]" will be changed to "[[this.addedImages.imageURL]]"

check Data binding in polymer for more info

append('<iron-image src="[[\' +this.addedImages.imageURL+ \']]"></iron-image>');
Mr_Perfect
  • 8,254
  • 11
  • 35
  • 62