Component Template
<form #formGroupContactUs_Template = "ngForm" (ngSubmit)="contactUsTemplateSubmit()">
<input type="text" class="form-control" name="name" [(ngModel)]="model.name">
<!-- {{name!.value}} -->
<button class="btn btn-primary mr-2" type="submit"
[disabled]="this.formGroupContactUs_Template.status != 'VALID'">Submit</button>
<a class="btn btn-secondary" (click)="clearAll()">Clear All</a>
</form>
Component Class
export class TemplateComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
model: any = {
name: "",
};
contactUsTemplateSubmit() {
console.log(this.model); //form Values
}
clearAll() {
this.model.reset(); // not working
}
}