For example:
<img src="{{profile.avatar}}"/>
Do I really have to create a helper for this or is it possible to write the attribute string
For example:
<img src="{{profile.avatar}}"/>
Do I really have to create a helper for this or is it possible to write the attribute string
You use the bind-attr
-helper for this. bindAttr
will also work but is deprecated since 1.0 RC8 as pointed out by intuitivepixel.
<img {{bind-attr src=profile.avatar}}/>
More info is available in their guide.
For Ember newcomers (whom came to this question by Googleling for example), since Ember 1.11 and later, you should write:
<img src="{{profile.avatar}}"/>
Just as OP wrote in his question!
Note:
Since Ember 1.13 the bind-attr
helper has been deprecated.