Hi,

Anyone can help me with my question?

In my app, i have this models: User and Team. One team has many users, ok?

So, when i need to update an single user, first i list the users and after 
put a single user. I am using Restangular.

User.getList() # GET /api/users

#for a single user
user.put() # PUT /api/users/:userId

Now, i need to configure goals for users. For this, i am listing teams and 
the users of it:

Teams.getList() # GET /api/teams
#for each team, i fill the users of it
team.getUsers() #GET /api/teams/:teamId/users


Goals are embeded in user, so after update goals in view, to update a 
single user again, i do:

user.put() # PUT /api/teams/:teamId/users/:userId.

Restangular build this route because i get users from team, but the correct 
route (or not) for update an user is: /api/users/:userId

What can i do in this situations:

1) Create an new controller in backend, like Api/teams/users_controller?

2) After get users from team, configure the correct route for each instance?

3) Another solution.. 





-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to