Created
October 29, 2013 04:13
-
-
Save JeffreyATW/7209085 to your computer and use it in GitHub Desktop.
Beginnings of our guest backbone app
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 Guest = Backbone.Model.extend(); | |
var Table = Backbone.Model.extend(); | |
var firstGuest = new Guest(guests[0]); | |
var GuestView = Backbone.View.extend({ | |
initialize: function () { | |
this.listenTo(this.model, 'change', this.render); | |
}, | |
tagName: 'h1', | |
className: 'guest', | |
render: function () { | |
this.$el.append(this.model.get('name')); | |
} | |
}); | |
var firstGuestView = new GuestView({ | |
model: firstGuest | |
}); | |
firstGuestView.$el.appendTo('body'); | |
firstGuest.set('name', 'Arnold Schwarzenegger'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment