showing results for - "form reset input angular"
Kent
31 Jan 2021
1<input type="text" [(ngModel)]="name" required />
2<button (click)="handleClear()">Clear input field</button>
Lucia
19 Aug 2018
1import { Component } from '@angular/core';
2
3@Component({
4  selector: 'my-app',
5  templateUrl: './app.component.html',
6  styleUrls: [ './app.component.css' ]
7})
8export class AppComponent  {
9  name = 'Angular';
10  handleClear(){
11    this.name = ' ';  }
12}