Restangular: long url with params


I’m trying to do such query url:'company').one('manager').one(managerId).get(params)

which should be for example:


but something went wrong, and i get:

Error: You're creating a Restangular entity with the number instead of the route or the parent. For example, you can't call .one(12).

What i do wrong?

What is the best way of solving this issue?

sure, i can do this:'company').one('manager/' + managerId).get(params)

but it’s to ugly way…

Solution'company').one('manager', managerId).get(params)

Answered By – Mikko Viitala

Answer Checked By – Cary Denson (AngularFixing Admin)

Leave a Reply

Your email address will not be published.