What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-11 23:39:02
how to bind the value of keyup event in runtime to a variable
<!-- Type script file --> import { Component } from '@angular/core'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: [ './app.component.css' ] }) export class AppComponent { sa... Add solution -
Other 2021-09-02 11:18:03
resize() { this.elementRef.nativeElement.style.height = '4px'; this.elementRef.nativeElement.style.height = this.elementRef.nativeElement.scrollHeight + 'px'; }
<textarea (keyup)="autoGrowTextZone($event)"></textarea> autoGrowTextZone(e) { e.target.style.height = "0px"; e.target.style.height = (e.target.scrollHeight + 25)+"px"; } Add solution