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'.
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:
but can't figure out how to use it in a controller!
I'd like to do something like:
The text was updated successfully, but these errors were encountered: