Sunday, 1 October 2017

Md inline input without directives in angular 2 or 2+ : 


hi here i have entered how to use inline input without directives =>

you just change the model name and value in the below code and use this thing and change the css also according to your code...

propertyName:  <span *ngIf='!propertyName_edit' (click)="propertyName_edit=true">{{propertyName}}<md-icon mdSuffix class="propertyName">mode_edit</md-icon></span>

 <input *ngIf='propertyName_edit' (keydown)="handleKeyDown_propertyName($event,i)" (focusout)="propertyName_edit=false" [value]="propertyName" autofocus/>



handleKeyDown_propertyName(event,i)
{
if (event.keyCode == 13)
{
this.test_value[i].propertyName=event.target.value;
this.propertyName_edit=false;
}
}