绑定到名称中带点的对象 属性

Binding to an object property with dots in the name

我需要绑定到一个名为

的对象 属性
errors : {
  'name.content' : {
      presence : true
   }
}

我不知道该怎么做,因为下面的方法不起作用。

errorsBinding : 'controller.errors["name.content"]'

我无法控制对象 属性 name.content 的名称,因为它是 ember-验证的一部分,所以我无法将其更改为其他名称。

也许你可以用 \ 转义点:

errorsBinding : 'controller.errors["name\.content"]'

我成功了

errorsBinding : 'controller.errors.name\.content'