Skip to content

Instantly share code, notes, and snippets.

@ericf
Created May 6, 2013 03:38
Show Gist options
  • Select an option

  • Save ericf/5523231 to your computer and use it in GitHub Desktop.

Select an option

Save ericf/5523231 to your computer and use it in GitHub Desktop.
Y.Guest = Y.Base.create('guest', Y.Model, [Y.ModelSync.REST], {
root: '/guests/'
});
Y.Guests = Y.Base.create('guests', Y.ModelList, [Y.ModelSync.REST], {
model: Y.Guest
});
Y.Invitation = Y.Base.create('invitation', Y.Model, [Y.ModelSync.REST], {
root: '/invitations/',
initializer: function () {
this.guests = new Y.Guests({bubbleTargets: this});
},
_setGuests: function (guests) {
return this.guests.reset(guests);
}
}, {
ATTRS: {
guests: {setter: '_setGuests'}
}
});
@ericf
Copy link
Copy Markdown
Author

ericf commented May 6, 2013

@olanb7 are you talking about the model contains a model list part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment