title: Angular: how to pass $scope variables into the Node.js server.
body: <p>right now I have this form: </p>
  
  <pre><code>&lt;form ng-submit = "submit()"ng-controller = "formCtrl"&gt;
                  &lt;input ng-model="formData.stickie" type="text" id="sticky_content" /&gt;
                  &lt;button type="submit" id="add_sticky" value="add a new stickie!"&gt;new sticky&lt;/button&gt; 
          &lt;/form&gt;
  </code></pre>
  
  <p>controlled by this model: </p>
  
  <pre><code>app.controller('formCtrl',function($scope,$http){
  
          $scope.submit = function() {
                  $http.post('/api/stickies', $scope.formData)
                                  **** somehow assign data to something useable by the function below???******
  
                          })
                          .error(function(data){
                                  console.log('Error: ' + data);
                          });
          };
  });
  </code></pre>
  
  <p>and I want to be able to use the posted data in here: </p>
  
  <pre><code>app.post('/api/stickies',function(req,res){
          var test = formData.stickie;    //returns undefined for sticky and for formData.stickie
          db.run("INSERT INTO stickies (data) VALUES (?)", [ test ]);
  });
  </code></pre>
  
  <p>so in summary, I am trying to pass the $scope.formData variable into my server.js file so that it can be used in my app.post function (and inserted into the db)</p>
  
  <p>Edit: updated code in accordance with answer given below: currently getting `ReferenceError: formData is not Defined, when I submit the form. </p>