title: in angular, how to get select/ ngModel previous value after change event fire
body: <p>I am working Angular 2 form and have drop-down/ select in template whose data is bind with ngModel and onChnage event. I need to detect previous value of ngModel? I have tried with data-* attributes 
  <a href="https://www.w3schools.com/tags/att_global_data.asp" rel="nofollow noreferrer">https://www.w3schools.com/tags/att_global_data.asp</a> to store current value in it, hoping it won't change with ngModel value, followed by send back when event fire but getting NaN value when it pass on change. </p>
  
  <p>drop-down / select initial values are mapped from array that is question[], current defaultValue is in "question.value"</p>
  
  <h2>template</h2>
  
  <pre><code>&lt;div *ngSwitchCase="'dropdown'"&gt; &lt;small&gt;dropdown&lt;/small&gt;
             &lt;div class="form-group"&gt;
                  {{question.value}}
                 &lt;select [id]="question.key" 
                         [formControlName]="question.key" 
                         [(ngModel)]="question.value"  
                         data-default-element="question.value"     
                         (change)="onChangeValue($event, responseId, question.key, data-default-element , 'dropdown')" 
                         (blur)="onChangeValue($event, responseId, question.key, data-default-element , 'dropdown')"
                         &gt;
  
                     &lt;option *ngFor="let opt of question.options" 
                             [value]="opt.key" &gt;{{opt.value}} &lt;/option&gt;
                 &lt;/select&gt;
             &lt;/div&gt;            
         &lt;/div&gt;  
  </code></pre>
  
  <h2>component</h2>
  
  <pre><code>onChangeValue(event: any, givenResponseId:string, givenQuestionId:string, defaultValue:string, givenInputType:string) { 
  
      var givenAnswer = null;
  
      console.log("defaultValue  ",defaultValue);
  
      if(event.target.value !="")
      {
         givenAnswer = event.target.value;
         console.log("newValue  ",givenAnswer );
      }
  
   }
  </code></pre>