We’ve connected our Ember app using the Django Rest adapter written by @toranb. So far it’s working quite well, but I have a question about properties. We’re adding a set of CSS class to one of the HTML elements. Right now the variable containing those classes is hard-coded avatar-icon icon-twitter
but I’d like to make it dynamic as the only part which changes is twitter
(facebook
, pinterest
, etc.).
Using bindAttr
to bind Ember variables to an attribute is easy:
<i {{bindAttr class="account.classlist"}}></i>
But I’m wondering how I can make the value dynamic. I’d also like to know how I can hardcode one class avatar-icon
while still allowing the other one to pull from the model.
Thoughts? Is there something simple that I’m missing? Would you suggest an alternate course?