Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created May 12, 2013 02:49
Show Gist options
  • Save marti1125/5562230 to your computer and use it in GitHub Desktop.
Save marti1125/5562230 to your computer and use it in GitHub Desktop.
Backbone 01 Code School
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});
appointmentView.render();
$('#app').html(appointmentView.el);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment