mercredi 8 janvier 2020

EmberJS: How to load assets relative to rootURL or load assets using absolute path

this might be a pretty common question but what I found on google does not help me.

I have a emberJs Project with all assets(images, etc) in my-ember-project/public/assets/images/ everything works fine when i load the assets from homepage which is the root URL "/" or localhost:4200

for example in my homepage I have a component with img tag which looks like this

<img src="assets/images/articles/article-1.jpg"/>

on another page with url localhost:4200**/articles/** I also load the same image with the same tag but from what I've seen it tried to load the image from localhost:4200/articles/assets/images/articles/article-1.jpg and not from the correct path localhost:4200/assets/images/articles/article-1.jpg

adding "/" before "assets/images/" works for me if I'm trying to host my project on root folder but when I need to host my project on subdirectory so my url (https://ift.tt/2t2jegV)

how do I load my assets from absolute path or relative to my settings of rootURL adding seems to do nothing to me




Aucun commentaire:

Enregistrer un commentaire