title: How to pass form parameters to Rest using angularjs services?
body: <p>I try to pass my form parameters to java rest backend but i cant.</p>
  
  <p>controller</p>
  
  <pre><code>$scope.addNewThing = function () {
      Myservice.addNew($scope.name);
  };
  </code></pre>
  
  <p>service</p>
  
  <pre><code>addNew: function (name) {
       var Foo = $resource($rootScope.baseUrl + '/path/addNew', {}, {
            save: {method: 'POST', params: {}}
       });
  
       var results = Foo.save({name: name}, function(data) {
            results = data;
       });
  
       return results;
  }
  
  //also tried this version of code
  
  addNew: function(name) {
  
       return $resource($rootScope.baseUrl + '/path/addNew', {}, {
           save: {method: 'POST', params: {name: 'test'}}
       });
  }
  </code></pre>
  
  <p>rest backend function</p>
  
  <pre><code>@POST
  @Produces("application/json")
  @Path("/addNew")
  public Response addNew(@FormParam("name") String name) {
      try {
           //when i check name here it is always null
           ...
      }
  }
  </code></pre>
  
  <p>I can't pass the html form parameter to java rest backend via angular. Also tried to change <code>@FormParam</code> to <code>@QueryParam</code> but it didn't work.</p>