vendredi 9 décembre 2016

relative image source ember js

i have a problem with assets path in emberjs(ember-cli).

I have 2 routes: index and article route, the path for index route is just a / and the path for the article route is article/:article_id

router.js

Router.map(function() {
    this.route('article', {path : '/article/:article_id'});
});

In the idnex template, i reference my assets that are in the directory public/assets/ with the following : <img src="/assets/images/image1.jpg/> and its work great, but when i use the same tag in the article template, the image is not loaded, and the cause is that the client(browser) send the request to the server with the following url localhost:4200/article/assets/images/image1.jpg.




Aucun commentaire:

Enregistrer un commentaire