Polymer resolvePath for relative resource path -


i try solve resource loading error in vulcanized polymer-app. i’ve read docs method resolvepath doesn’t seems fix problem. project structure:

test ├── assets │   └── avatar.png ├── components │   └── custom-elem-with-relative-path-to-avatar.html └── index.html 

custom-elem-with-relative-path-to-avatar.html

<polymer-element name="aw-account” layout vertical> …     <img src="{{avatarimage}}" id="profileavatar" alt="image profile”> … </template> <script>     polymer('aw-account', {         ready: function () {             this.avatarimage = this.resolvepath('../assets/avatar.png');             … </script> </polymer-element> 

due ../ image src 1 level above correct folder!

how have use method resolvepath resource avatar.png loaded correctly in vulcanized-app?

you should use

this.resolvepath('./assets/avatar.png') 

in polymer 0.5 or

this.resolveurl('./assets/avatar.png') 

in polymer 1.0


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -