title: Angular 5 submitting form programmatically don't send correct values
body: <p>In my angular 5 application I need to submit a hidden form programmatically after an Http GET call, but when the form is submitted the three variables I am sending seems empty (but they don't).</p>
  
  <p>In my component I have :</p>
  
  <pre><code>@ViewChild('testForm') testFormEl: any;
  
  
  this.ticketService.postTicketWithCreditPayment(param)
      .subscribe(res =&gt; {
          this.paymentUrl = res.url;
          this.paymentXml = res.xml;
          this.paymentHash = res.hash;
  
          console.log(this.paymentUrl) &lt;-- this log make me see the correct paymentUrl 
  
          this.testFormEl.nativeElement.submit();
       })
      }
  </code></pre>
  
  <p>And in my html I have the form with 3 hidden fields</p>
  
  <pre><code>&lt;form #testForm name="form1" action="https://...url..." method="post"&gt;
      &lt;input type="hidden" name="url" [value]="paymentUrl"&gt;
      &lt;input type="hidden" name="xml" [(ngModel)]="paymentXml"&gt;
      &lt;input type="hidden" name="hash" [(ngModel)]="paymentHash"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I try binding with <code>[value]</code> and <code>[(ngModel)]</code> but the form submitted is always this:
  <a href="https://i.stack.imgur.com/shAlX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/shAlX.png" alt="enter image description here"></a></p>
  
  <p>Is probably related to : <a href="https://stackoverflow.com/questions/48077840/angular-submit-a-form-programmatically">stackoverflow</a></p>