我有一个模型实例,我设置了另一个模型实例,即model.set('rsvp', new App.Rsvp).
当我遍历集合以在视图中生成它们的列表时,我undefined在调用时得到model.rsvp.get('attending').
然而,当我这样做时,console.log(model.rsvp)我得到了这个:
Rsvp
_changing: false
_escapedAttributes: Object
_moreChanges: false
_previousAttributes: Object
_setting: false
attributes: Object
attending: true
created_at: "2012-03-28T09:42:22-05:00"
event_id: 20
id: 12
updated_at: "2012-03-28T09:42:22-05:00"
user_id: 3
__proto__: Object
cid: "c53"
id: 12
__proto__: Rsvp
Run Code Online (Sandbox Code Playgroud)
所以看起来对象没有问题,但get返回undefined.
我必须承认我的Javascript技能仍然很弱.我在这里错过了什么?