title: Convert HTML form into Angular POST request
body: <p>I have this form in HTML and I am trying to convert it into a POST request using a frontend framework (either AngularJS or Angular2).  The purpose of this form is to allow a client to subscribe to my wordpress blog.  I am trying to convert it from PHP to Angular2 (if someone knows how to convert it to AngularJS I can convert to Angular2 from there).  How would I do this?  What would have to be in the body of the POST request vs query strings?  I am having trouble understanding exactly what role each part of this form plays in the POST request.</p>
  
  <p><strong>EDIT:</strong>  Just to clarify, I know how to use AngularJS and Angular2 and how to use the HTTP service in both of them.  I am wondering how to convert the form into the body/query strings of the request.</p>
  
  <pre><code>&lt;form action="/blog/" class="form-inline" role="form" method="POST" accept-charset="utf-8" id="subscribe-blog"&gt;
  
      &lt;!-- add hidden inputs for wordpress jetpack widget --&gt;
      &lt;input type="hidden" name="action" value="subscribe" /&gt;
      &lt;input type="hidden" name="source" value="http://www.mywebsite.com/blog/" /&gt;
      &lt;input type="hidden" name="sub-type" value="widget" /&gt;
      &lt;input type="hidden" name="redirect_fragment" value="blog_subscription-2" /&gt;
  
      &lt;label class="sr-only" for="exampleInputEmail"&gt;Email address&lt;/label&gt;
      &lt;input type="email" class="form-control wide" id="exampleInputEmail" placeholder="Enter email address"&gt;
      &lt;button type="submit" name="jetpack_subscriptions_widget" class="btn btn-submit"&gt;Subscribe&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Would something along the lines of this be correct?</p>
  
  <pre><code>postForm() {
      var body = {
          action: 'subscribe',
          source: 'http://www.mywebsite.com/blog/',
          sub-type: 'widget',
          redirect_fragment: 'blog_subscription-2',
          email: 'clientEmailAddress@gmail.com',  // don't think this is right
          // not sure what to do with `jetpack_subscriptions_widget` attribute on the submit button either
      };
      return this.http.post(`http://www.mywebsite.com/blog/`, body)
          .map(res =&gt; res.json())
          .toPromise()
          .then(data =&gt; {
              return data;
          });
  }
  </code></pre>