title: Bind object property to input and pass value to function on button click in angular
body: <p>I want to add text field value to a row in angular 8 when click a button in Angular 8.</p>
  
  <p>page.component.html</p>
  
  <pre><code>&lt;input type="number" [(ngModel)]="betOption3type" [formControl]="betOption3" class="form-control allownumericwithoutdecimal" style="text-align:right;"&gt;
  
  &lt;button type="button" class="btn btn-success btn-sm btn-round waves-effect waves-light m-1" id="addnewrecord" (click)="addRow(betOption3.value)"&gt;Add Bet&lt;/button&gt;
  
  &lt;tr *ngFor="let row of selectedOptions$ | async"&gt;
      &lt;td&gt;{{ row.code.value }}&lt;/td&gt;
      &lt;td&gt;{{ row.desc.value }}&lt;/td&gt;
      &lt;td&gt;{{ row.amount.value }}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>page.component.ts</p>
  
  <pre><code>export class NewBettingComponent implements OnInit {
    betOption = new FormControl();
    betOption2 = new FormControl();
    betOption3 = new FormControl();
    betOption3type = "";
    options$ = new BehaviorSubject([{ id: 1, value: 'Mark Verndom' }, { id: 2, value: 'Jacob Brown' }, { id: 3, value: 'Steve Rogurs' }]);
    options2$ = new BehaviorSubject([{ id: 1, value: 'CSN1' }, { id: 2, value: 'CIA5' }, { id: 3, value: 'CSI7' }]);
  
    selectedOptions$ = new BehaviorSubject([]);
    constructor() { }
  
    ngOnInit(){
    }
  
    addRow() {
      if (!this.betOption.value) {
          return;
      }
      if (!this.betOption2.value) {
        return;
      }
      if (!this.betOption3.value) {
        return;
      }
      const yourSelectedObject = this.options$.value.find(el =&gt; el.id === Number(this.betOption.value));
      const yourSelectedObject2 = this.options2$.value.find(el2 =&gt; el2.id === Number(this.betOption2.value));
      this.selectedOptions$.next([...this.selectedOptions$.value, {desc: yourSelectedObject, code: yourSelectedObject2, amount: this.betOption3type}]);
  
  }
  </code></pre>
  
  <p>When I try with above code I am getting only two select option values to dynamic <code>&lt;tr&gt;</code>. But text field value is not added to dynamic row. How can I solve this.</p>