modify resource using restangular by making put on name not id


I have profile resource which has

  1. profileName,
  2. firstName ,
  3. Lastname and
  4. id

here profileName is unique and used as resource identifier and id is just a count.

To modify resource it accept put request on

Now problem is whenever I’m making put request, it replace profile name with id. I am unable to make restangular put request on profileName.

Code is as follows.

          var profile=$scope.profiles[id];


It turn out that there was a problem with method which was handling put request at backend. Object I was passing has 4 properties in java code but when I was passing it from front end I was passing only 3. Previously I was trying

var items=Restanular.all("profiles").getList();
var item=items[i];
item.propertyName=New Value;;

This should have ideally work but I think it require some thing more as when I called save method it made a request on http://localhost:9090/messanger/api/
rather than making request on http://localhost:9090/messanger/api/[profileName]

Answered By – Naveen

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.