So say that ${thing}.png resolves to picture.png, it’s not that webpack can’t find picture.png, it’s that webpack seems to be looking for a file literally called ${thing}.png.
${thing} doesn’t seem to be getting resolved into a string. However, if I put ${thing} between p tags, then it does correctly get rendered into the proper string. So for some reason it’s resolving when it’s text, but not when it’s in an element’s attribute.
I’m going to be running into an issue where I’ll be serving the images up from a server. How would webpack handle that? Imagine an image viewer with 100s of images and they live in a database.
I’ve never really stored images directly in a database, if that’s what you mean? I’ve always stored details of the image and the path to where it’s stored on the file system - I’ve always found it more flexible. If you are storing the base64 encoded image data in a database, could you just add it to the img src like:
There is definitely flexibility in storing images on the filesystem which is what my project currently does, but we are building a completely distributed system so with that, storing in the db (Mongo) makes it easier for us. I’ll have to try what you posted, that may work without webpack complaining
Should be a one time bind <img src="${aircraftIcon & oneTime}">
or on your property @computedFrom(‘selectedRegistration’) -> scans for changes on that value
Hi, I want to pass image path from my component’s ts to html.
i tried with but it is not showing image, but when give the same path to src, it works.
Any suggestion.
If you see the url in the img element but its not visible, then probably the url is wrong. Either that or you put the img element inside an element that is not visible. Maybe try with some different img url and debug further?
I could see url in img element and i pasted same url to check whether is it visible… image is showing.
but when i am passing from ts , its not working.