0
我有一個變量以下數據:Backbone.js的 - 引導數據到收集
[{"age":"65","_id":"526fb6c940301e040e000002","name":{"first":"Jane","last":"Does"},"__v":0,"modified":"2013-10-31T10:03:26.435Z"},{"age":"25","_id":"526fb6c940301e040e000001","name":{"first":"John","last":"Doe"},"__v":0,"modified":"2013-10-31T10:03:26.436Z"},{"age":"45","_id":"526fb6c940301e040e000003","name":{"first":"Alice","last":"Smith"},"__v":0,"modified":"2013-10-31T10:03:26.436Z"}]
我試圖引導我收集與此數據。
this.collections.staff = new StaffCollection;
this.collections.staff.reset(data , {parse: true});
當我console.log(this.collection.staff)
,以下是結果:
我究竟做錯了什麼?
感謝
我用過,但都產生相同的結果。 http://documentcloud.github.io/backbone/#FAQ-bootstrap – Joe
我不知道那個鏈接,但無論如何,現在我正在檢查小提琴它也適用'var staff = new StaffCollection; staff.reset(data,{parse:true});'。你有沒有修改你的分析函數@Joe? – Puigcerber