You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to follow the documentation and after reading #139 and #1254 I'm more confused than ever.
I have some tables on my DB, let's say User, Customer and UserCustomer (which implements an n:n relation between User and Customer).
I have set up endpoints in my server at /user/[id], /customer/[id] and /user/[iduser]/customer/[idcustomer]
I can CRUD on User and Customer tables using the Restangular.service syntax:
In my User factory I would like to define a getCustomer method which populates an user instance with a customers variable, pointing to a collection of Customer.
Seems I can do something like:
That should be working, the only thing to note is that because you are passing 'null' in a the first parameter to restangularizeCollection, it won't build a nested url for you e.g. '/users/1/customers'.
Activity
daviesgeek commentedon Jun 16, 2016
You should be able to do that in a controller. What isn't working?
alexjose commentedon Dec 9, 2016
I am also trying to figure this out. How to build Nested decoupled services?
ashgibson commentedon Jan 12, 2017
That should be working, the only thing to note is that because you are passing 'null' in a the first parameter to restangularizeCollection, it won't build a nested url for you e.g. '/users/1/customers'.