Backbone js Access to chained attributes

23 views
Skip to first unread message

Samin Fakharian

unread,
Aug 6, 2016, 7:10:35 AM8/6/16
to backbonejs
As you can see I have this index.js file that I define some models and collections and views
here is what I want 
please first see json.png file




in this file you can see the result for line : 57 in index2.js 







console.log(JSON.stringify(this.collection.at(0).get('data')));


it will give me array of 10 object that I want them to be my models
but I have chained attributes 


view -->
           collection--->
                               models--->at location of (0)
                                                                      attributes----->
                                                                                            and then you can access data[0]

But with this.collection.at(0).get('data') (this refers to view) I can access data 
but I don't know how to populate my data with them??
Please Please Help me!
                                          

index2.js
json.PNG
Reply all
Reply to author
Forward
0 new messages