Answers for "angular call function on option select"

0

angular call function on option select

<select id="selectid" class="form-control-mb-12" (change)="modo($event.target.value)">
   <option value="mod1">MODO 1</option>
   <option value="mod2">MODO 2</option>
   <option value="mod3">MODO 3</option>
</select>

modo(value: string){
  switch(value) {
    case "mod1":
       // if modo 1 is selected do something.
       break;
    case "mod2":
       // if modo 2 is selected do something.
       break;
    case "mod3":
       // if modo 3 is selected do something.
       break;
  }
}
Posted by: Guest on May-05-2021

Code answers related to "angular call function on option select"

Code answers related to "Javascript"

Browse Popular Code Answers by Language