Why bind-attr src for my img added my hostname to src attr?


My model is store, and store.src means the actual image url, and in my template I wrote:

<img src={{bind-attr store.src}} />

I logged store.src to the console and it prints the correct image url without my hostname as a prefix, but in the page the actual image url became the hostname + store.src. For example, the value of store.src is: /, but in the page, 's src became:http://localhost:8888/ Why does this happen? How could I solve this problem? Thank you


This question is better left to stackoverflow, but I’ll answer it before it’s pretty clear what the problem is.

<img {{bind-attr src=store.src}} />



I found the problem. Because the src attr in store is without ‘http://’ prefix so my hostname is added. Thanks all the same:)