How to append string to bound img src?



I currently have an image that uses an url that is built from several parts. One part is from the model and another is appended such as “_large.jpg”. If I make the model data unbound this works but not if it’s bound. How could I solve this?

<img src="/photos/user/{{imageHash}}_large.jpg" alt="">

I also found this related topic:



Use the bind-attr helper. You can do the string concatenation in a computed property on the controller or model.


Thanks that worked like a charm :slight_smile: