ember.js - Defining an API endpoint on a model-by-model basis -
(this question continuation of this one)
i need specify api endpoints on model model basis. how can this? closest have come description of namespace, applies top-level url.
my problem api structure not 1 emberjs expects. example, have 2 objects, different api endpoints:
phones -> /api/nodes/extensions/phones nodes -> /api/nodes
how can configure endpoints each model?
if i'm not mistaken, should able set model
url property, this:
app.phone = ds.model.extend({ description: ds.attr('string'), number: ds.attr('string') }).reopenclass({ url: 'api/nodes/extensions/phones' }); app.node= ds.model.extend({ description: ds.attr('string') }).reopenclass({ url: 'api/nodes' });
i haven't tried revision 12, can't guarantee works.
alternatively, might want question & answer talks similar scenario, using adapter specific models introduced in revision 11.
Comments
Post a Comment