title: Getting undefined on passing form data to param in angular
body: <p>I am trying to pass values to <code>formData</code> from a form in my view, but when I am passing my parameters, it is showing <code>undefined</code>.</p>
  <pre class="lang-js prettyprint-override"><code>    // Initialize Params Object
      let myFormData = new FormData();
  
      // Begin assigning parameters     
      const username = myFormData.append('myUsername', this.registerForm.value.firstname);
      const email = myFormData.append('myEmail', this.registerForm.value.email);
  
      //post request
      return this.http.post('http://localhost:81/save.php/', myFormData).subscribe((res: Response) =&gt; {
          console.log(res);
      },
      (err) =&gt;{
          this.indexedDbService
              .addUser(username,email)  //  undefined , undefined
              .then(this.backgroundSync)
              .catch(console.log);
              // this.backgroundSync();
      })
  } 
  </code></pre>
  <p>However, if I try passing a hard-coded JSON object, it is taking properly.
  How can I pass data from <code>myFormData</code> into the parameters of <code>addUser</code> properly?</p>