In an Ember.js Handlebars template, is there a way to have both static and dynamic class attributes?

后端 未结 4 1970
青春惊慌失措
青春惊慌失措 2021-02-13 19:34

Using the already-overused to-do app example, let\'s say I want an element with a \"todo\" class (static) and an \"is-done\" class (dynamic):



        
4条回答
  •  渐次进展
    2021-02-13 20:18

    In ember 1.10.0, bindAttr is deprecated. You can directly bound a variable to class of div. here the color variable is bound to the class of a div:

    The inline if helper can also be used in these contexts:

    http://emberjs.com/blog/2015/02/07/ember-1-10-0-released.html

提交回复
热议问题