ember-resource
ember-resource copied to clipboard
Schema cannot be reopened
When sharing code across multiple projects, it makes sense to put core classes in a shared library. Individual projects would then reopen the core classes to add functionality specific to their use-cases. For example:
User = Ember.Resource.define({
organization: { type: 'Organization', nested: true }
});
User.reopenSchema({
posts: {
type: Ember.ResourceCollection,
itemType: 'BlogPost',
url: '/users/%@/posts'
}
});