×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Nilesh Yadav
Added: Nov 14, 2017 7:15 PM
Views: 3
Tags: no tags
  1. <select [ngModel]="selectedItem" (ngModelChange)="onChange($event)">
  2.  
  3. onChange(newValue) {
  4.     console.log(newValue);
  5.     this.selectedItem = newValue;  // don't forget to update the model here
  6.     // ... do other stuff here ...
  7. }