Skip to content

Instantly share code, notes, and snippets.

@codeschool-courses
Created March 7, 2012 21:25
Show Gist options
  • Save codeschool-courses/1996339 to your computer and use it in GitHub Desktop.
Save codeschool-courses/1996339 to your computer and use it in GitHub Desktop.
Anatomy of Backbone 1-7
var Appointment = Backbone.Model.extend({});
var appointment = new Appointment();
appointment.set('title', 'My knee hurts');
var AppointmentView = Backbone.View.extend({
render: function(){
$(this.el).html('<li>' + this.model.get('title') + '</li>');
}
});
var appointmentView = new AppointmentView({model: appointment});
@Gero1369
Copy link

this exercise, "Set the Title", and "View Instance" seem not to be working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment