VSCode-Angular-TypeScript-Snippets icon indicating copy to clipboard operation
VSCode-Angular-TypeScript-Snippets copied to clipboard

Request for snippet to do two way databinding

Open pradt opened this issue 6 years ago • 0 comments

Hi, I just went through the painful processes of setting up a custom data binding for number of properties. It would be great if you could include snipet for two way data binding for typescript using getters/setters :

public _Name:string = "";
@Output() NameChange:EventEmitter<string> = new EventEmitter<string>();
@Input()
set Name(value:string)
{
console.log("yeah")
this._Name = value;
this.NameChange.emit(value);

}
get Name():string
{
  return this._Name;

}

pradt avatar Mar 28 '19 01:03 pradt