Ember.js 绑定到名称中带有点的对象属性
我需要绑定到一个名为Ember.js 绑定到名称中带有点的对象属性,ember.js,Ember.js,我需要绑定到一个名为 errors : { 'name.content' : { presence : true } } 我不知道怎么做,因为下面的方法不起作用 errorsBinding : 'controller.errors["name.content"]' 我无法控制对象属性的名称name.content,因为它是余烬验证的一部分,所以我无法将其更改为其他内容。可能是您可以使用\逃出点,如下所示: errorsBinding : 'controller.erro
errors : {
'name.content' : {
presence : true
}
}
我不知道怎么做,因为下面的方法不起作用
errorsBinding : 'controller.errors["name.content"]'
我无法控制对象属性的名称
name.content
,因为它是余烬验证的一部分,所以我无法将其更改为其他内容。可能是您可以使用\
逃出点,如下所示:
errorsBinding : 'controller.errors["name\.content"]'
我让它工作了
errorsBinding : 'controller.errors.name\.content'