Q:

Clearing text field with button by passing text field id to a function TypeScript

I have several buttons on a web page that will each clear the text box on the same line. I am currently using a different function for each button, but I want to be able to do it with a single function by passing in the text field ID. 
What I have now: HTML 
<div class="col-sm-4">
     <input type="text" class="form-control" id="textField1" formControlName="textField1" />
</div>
      <button class="btn btn-danger" (click)="clearTextField1()"><i class="fa fa-times"></i></button>

and the function: 
clearTextField1(): void {
    return this.form.controls["textField1"].setValue('');
}

and so on for each button.. How would I accomplish this with a single function by passing in the text field ID? 

A:

Just pass the formcontrolname in the click functions 
  <button class="btn btn-danger" (click)="clearTextField1('textField1')"><i class="fa fa-times"></i></button>

and the function:
clearTextField1(field:String): void {
    return this.form.controls[field].setValue('');
}

