Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created March 3, 2013 19:21
Show Gist options
  • Save EdwardIII/5077789 to your computer and use it in GitHub Desktop.
Save EdwardIII/5077789 to your computer and use it in GitHub Desktop.
the_event.fetch({success: function(){
var tickets = the_event.get('tickets');
var guestlist = new GuestList();
for(i=0; i<tickets.length; i++){
tickets[i]['desired_quantity'] = ko.observable(0);
guestlist.add(tickets[i]);
}
console.dir(tickets);
var viewModels = {
ticketViewModel: new TicketViewModel(tickets),
'guestlist': guestlist,
personalDetailsViewModel: new PersonalDetailsViewModel()
}
ko.applyBindings(viewModels);
}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment