title: Angular 5 - reactive form- is there a way to patch value using a variable?
body: <p>I have a form group with many fields :</p>
  
  <pre><code>    this.addressForm = this.formBuilder.group({
          line1: ['', Validators.required],
          line2: '',
          line3: '',
          line4: '',
          line5: '',
          line6: '',
          line7: '',
          line8: '',
      });
  </code></pre>
  
  <p>In my html I have a form field to each formControl and a button near it that clears that form control.</p>
  
  <pre><code>                &lt;mat-form-field&gt;
                      &lt;mat-label&gt;line 1&lt;/mat-label&gt;
                      &lt;input matInput formControlName="line1" type="text"&gt;
                      &lt;button type="button" (click)="clearLine('line1')"&gt;
                      &lt;/button&gt;
                  &lt;/mat-form-field&gt;
  </code></pre>
  
  <p>How Can I write a <em>generic</em> methods that gets the name of the form control and clears it?</p>
  
  <p>I tries this-</p>
  
  <pre><code>clearLine(line) {
      this.addressForm.patchValue({line: ''});
  }
  </code></pre>
  
  <p>but that did not work, because it searched for a formControl name "line".</p>
  
  <p>Is there any way to do this without execute many "if" conditions?</p>