假设我有类似的东西:
{{input value=someModel }}
然后我想将简单的required
HTML 5 属性添加到输入中。
我该怎么做?
请注意,我尝试了以下变体但没有成功:
{{input value=someModel required }} <!-- doesn't parse -->
{{input value=someModel required='required' }} <!-- doesn't render the attribute -->
{{view Ember.TextField valueBinding=someModel
required='required' }} <!-- doesn't render the attribute -->
<input required {{bindAttr value=someModel}}
/> <!-- doesn't update the model, as expected -->
更新:这个问题是针对 Ember 1.0 的。