Lets Start
devices = new SmartLink.Collections.DeviceMap
view = new SmartLink.Views.DeviceMap({collection: devices})
My Collection
parse: function (response) {
console.log(response.sites);
return response.sites;
}
My View
initialize: function (options) {
this.collection.on('add',this.addOne,this);
this.collection.on('reset',this.addAll,this);
this.collection.fetch();
},
addAll: function() {
console.log("addall");
this.collection.forEach(this.addOne,this);
},
addOne: function(site) {
console.log("addone");
console.log(site);
},
- When parse, it prints out the response as you can see from the array of objects
- starts addAll
- then addOne them individually
My Question
When I loop through each item, where is all my attributes for each item in the array?.
The only thing I see is the id’s.
If I try console.log(site.name), it says undefined.

Use
site.get('name')to get the name attribute. You have to use the functiongetto get attributes from your models.