title: AngularJS: Post nested JSON parameter
body: <p>I want to post nested JSON parameters to my rails app. It works with <strong>jquery</strong>:</p>
  
  <pre><code>$.ajax({
                  type : 'POST',
                  dataType : 'json',
                  url : 'https://example.com/users/sign_in.json',                                
                  data : {
                      user : {
                          email : $('input[name="email"]').val(),
                          password : $('input[name="password"]').val()
                      }
                  }
              }).success(...
  </code></pre>
  
  <p>But how does it work with <strong>AngularJS</strong>? Posting non-nested parameters works:</p>
  
  <pre><code>$http({ method: 'POST', 
              url: 'https://xxx.herokuapp.com/users/sign_in.json',
              data: {email: $scope.user.email, password:$scope.user.password}
              }).success(...
  </code></pre>
  
  <p>But how do I post nested parameters? Any ideas? Thank you in advance!</p>