Answers for "how to bind the value of keyup event in runtime to a variable"

0

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  {

       sampleString: string;

       updateBox(e) {
         this.sampleString = e.target.value; 
       }

    }

<!-- Html File -->
<input #box (keyup)="0" (input)="updateBox($event)">
  <p>{{box.value}}</p>
<p>This is sampleString Value: {{sampleString}} </p>
Posted by: Guest on November-04-2020

Code answers related to "how to bind the value of keyup event in runtime to a variable"

Browse Popular Code Answers by Language