148
rated 0 times
[
149]
[
1]
/ answers: 1 / hits: 27154
/ 10 Years ago, fri, july 18, 2014, 12:00:00
I created an array of 2 images and tried to display them, but instead of the images I got the text:
object HTMLImageElement
I am sure my images are in the right directory which I am currently working with.
< template is=auto-binding>
<section flex horizontal wrap layout>
<template repeat={{item in items}}>
<my-panel>{{item}}</my-panel>
</template>
</section>
<script>
(function() {
addEventListener('polymer-ready', function() {
var createImage = function(src, title) {
var img = new Image();
img.src = src;
img.alt = title;
img.title = title;
return img;
};
var items = [];
items.push(createImage(images/photos/1.jpeg, title1));
items.push(createImage(images/photos/2.jpeg, title2));
CoreStyle.g.items = items;
addEventListener('template-bound', function(e) {
e.target.g = CoreStyle.g;
e.target.items = items;
});
});
})();
</script>
What am I missing here?
More From » html