Skip to content

Instantly share code, notes, and snippets.

@marka2g
Created March 29, 2012 02:22
Show Gist options
  • Save marka2g/2232574 to your computer and use it in GitHub Desktop.
Save marka2g/2232574 to your computer and use it in GitHub Desktop.
CodeSchool Backbone Ch1
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('
' + this.model.get('title') + ' ');
}
});
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