I am new to backbone.js. I have 2 javascript files. 1 for collection and 1 for view.
**collection.js**
var colle = Backbone.Collection.extend({
initialize: function () {
var data = [
{ Name: "a", Image: "path1" },
{ Name: "b", Image: "path2" },
];
}
});
and my view.js is
var View = Backbone.View.extend({
initialize: function () {
this.collection = colle;
},
render:function(){
//How can I access that data here ?
}
});
var view1 = new View();
How can I access my Collection data in View ?
Thank you.