<div id="lists">
<table id='mytable' cellspacing='0' cellpadding='0'>
<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' : ''}">
<td class='default-field'>
<p class='para' *ngIf="selectedIndex!=i ">{{i+1}}. {{item}}</p>
</td>
<td class="edit-field" *ngIf="selectedIndex==i " >
<input type="text" class="myCl" [value]="val" >
</td>
<td class='btns'>
<input type='button' value='edit' class='edit-btn' (click)='hidePara(item,i)' *ngIf="selectedIndex!=i">
<input type='button' value='save' class='save-btn' *ngIf="selectedIndex==i" (click)='hidePara1(item,i)'>
<input type='button' value='DELETE' class='delete-btn' (click)='deleterow(i)'>
</td>
</tr>
</table>
</div>
Above is my html code, i want to retrieve the value of input field when user click on save button, the hidePara1(item,i) function will execute, i want to get value of input field in hidepara1, how this can be possible.
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
}