Answers for "form reset input angular"

0

form reset input angular

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  name = 'Angular';
  handleClear(){
    this.name = ' ';  }
}
Posted by: Guest on September-24-2021
0

form reset input angular

<input type="text" [(ngModel)]="name" required />
<button (click)="handleClear()">Clear input field</button>
Posted by: Guest on September-24-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language