platanus / angular-restmod

Rails inspired REST-API ORM for Angular
http://platanus.github.io/angular-restmod/
MIT License
1.18k stars 87 forks source link

Make $find accept params #76

Closed crissi closed 10 years ago

crissi commented 10 years ago

Sometimes I may want to recieve a customer with id 2. But also eagerload some resources onto the relation.

so it would be nice if $find(id) could take a second argument.

like $find(id, params)

so I could retrieve something like customers/2?include=history

iobaixas commented 10 years ago

I will add this to the 1.0 milestone since is almost implemented, you could use:

var customerWithHistory = Customer.$new(id).$fetch({ include: 'history' });

For the same effect in the meantime

crissi commented 10 years ago

Awesome, and thx for the temporary solution

Sendt fra min iPhone

Den 13/08/2014 kl. 15.54 skrev "Ignacio Baixas" notifications@github.com:

I will add this to the 1.0 milestone since is almost implemented, you could use:

var customerWithHistory = Customer.$new(id).$fetch({ include: 'history' }); For the same effect in the meantime

— Reply to this email directly or view it on GitHub.