Created
March 29, 2012 02:22
-
-
Save marka2g/2232574 to your computer and use it in GitHub Desktop.
CodeSchool Backbone Ch1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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