lundi 26 septembre 2016

Reference rootURL / any absolute path in hbs

The ember-cli-generated index.html file includes this line

<script src="assets/vendor.js"></script>

and rootURL is replaced with respective the value from environment.js (just '/' in develompent).

Now I want to include an icon in a component (in fact, a template used only with partial) used in different routes (also at different nesting levels), but

<img src="assets/img/some_logo.svg">

just does not do the trick -- rootURL is empty, as is any other string else defined in environment.js.

I guess I could create a class file, import ENV from '../config/environment' and defined rootURL: ENV.rootURL, but surely ember does not expect me to do this whereever I want to include anything from my assets folder, does it?




Aucun commentaire:

Enregistrer un commentaire