HTML import relative path -
i'm writing webcomponent. therfore have index.html in import webcomponent:
<link rel="import" href="components/test.html">
as see have component in specific folder relative index.html. when want access ressource test.html in components folder. want like:
background-image: url("test.gif");
for css or:
<img src="test.gif">
but doesn't work. works when change path relative of image index.html like:
<img src="components/test.gif">
i know can tricks document.currentscript.baseuri
want write plain css , html. there easy way so?
you might want take @ how polymer guys it. code in src/standard/resolveurl.html (snapshot) , src/lib/resolve-url.html (snapshot).
it isn't pretty. alone, infer @ time of writing answer question seems "no, isn't easy , there no way without using tricks".
Comments
Post a Comment