Answers for "how to get selected value from between form tags in Angular"

0

how to get selected value from between form tags in Angular

//component.html
<select class="form-control" #t (change)="callType(t.value)">
      <option *ngFor="#type of types" [value]="type">{{type}}</option>
    </select>

//component.ts
this.types = [ 'type1', 'type2', 'type3' ];
   this.order = {
      type: 'type1'          
  };  

  callType(value){
    console.log(value);
    this.order.type=value;
  }
Posted by: Guest on April-17-2021

Code answers related to "how to get selected value from between form tags in Angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language