title: How to get value of input field in typescript file Angular 4
body: <pre><code> &lt;div id="lists"&gt;
              &lt;table id='mytable' cellspacing='0' cellpadding='0'&gt;
                  &lt;tr  class="row" [ngClass]="{'selected': i === selectedIndex}"  *ngFor= 'let item of list; let i = index' [attr.data-index]='i'  [ngStyle]="{'background-color': i%2 == '0' ? 'gray' : ''}"&gt;
                      &lt;td class='default-field'&gt;
                          &lt;p class='para' *ngIf="selectedIndex!=i  "&gt;{{i+1}}. {{item}}&lt;/p&gt;
                      &lt;/td&gt;
                      &lt;td class="edit-field" *ngIf="selectedIndex==i   " &gt;
                          &lt;input type="text" class="myCl" [value]="val" &gt;
                      &lt;/td&gt;
                      &lt;td class='btns'&gt;
  
                      &lt;input type='button' value='edit' class='edit-btn'  (click)='hidePara(item,i)' *ngIf="selectedIndex!=i"&gt;
  
                      &lt;input type='button' value='save' class='save-btn' *ngIf="selectedIndex==i" (click)='hidePara1(item,i)'&gt; 
                      &lt;input type='button' value='DELETE' class='delete-btn' (click)='deleterow(i)'&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
  
          &lt;/div&gt;
  </code></pre>
  
  <p>Above is my html code, i want to <strong>retrieve the value</strong> of input field when user click on save button, the <strong>hidePara1(item,i)</strong> function will execute, i want to get <strong>value</strong> of input field in hidepara1, how this can be possible.</p>
  
  <pre><code> hidePara1(item,ii)
   {
    this.selectedIndex=-1;
    this.showHideP = !this.showHideP;  //for hiding paragraph
    this.tbox = !this.tbox;  //showing text box
    this.edt=!this.edt;  //hide edt button
    this.sbtn = !this.sbtn;  //display save button 
  
   }
  </code></pre>