2017-01-15 62 views
0

我有有通过使穿上名称不是ID

  1. PROFILENAME轮廓资源修改使用restangular资源,
  2. 名字,
  3. 姓氏和
  4. ID

这里PROFILENAME是唯一的,用作资源标识符,id只是一个计数。

要修改资源它 http://localhost:9090/messanger/api/[profileName]

接受PUT请求现在的问题是,每当我做放置请求,它与ID替换配置文件名称。我无法对profileName进行重新放置请求。

代码如下。

$scope.editUser=function(id){ 
      var profile=$scope.profiles[id]; 
      $scope.profile=profile; 
      profile.save().then(function(res){ 
       console.log(res); 
      }); 
     } 

回答

0

事实证明,在后端处理放置请求的方法存在问题。对象我经过在Java代码中4个属性,但是当我从前端传递我是路过只有3个。以前我是想

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

这应该有理想的工作,但我认为它需要一些更多的东西作为当我打电话给保存方法时,它在http://localhost:9090/messanger/api/ 上发出请求,而不是在http://localhost:9090/messanger/api/[profileName]上提出请求

相关问题