var myContentView = Backbone.View.extend({
el: "#myContent",
initialize: function()
{
this.$el.html(this.collection.models[0].get("name"));
}
})
var Person = Backbone.Model.extend({
defaults:{
name:"John Smith"
}
});
var Persons = Backbone.Collection.extend({
model: Person
});
var person1 = new Person({name:"Jim Smith"});
var personsCollection = new Persons();
personsCollection.add([person1]);
const myCV = new myContentView({collection: personsCollection});