Help with Backbone needed:
var Vehicles = Backbone.Model.extend({}, {
name: 'Sabre',
summary: function() {
console.log(this.name +" is a dog!");
}
});
Vehicles.summary();
This prints out: " is a dog"
Two questions:
-
Why doesn't it print out the name? Why doesn't this.name work?
-
On the following line, what is the difference between firstBlock and secondBlock?
Backbone.Model.extend({firstBlock},{SecondBlock});
Aucun commentaire:
Enregistrer un commentaire