I am new to angular. I am learning about angular forms and though I copied the below code from a tutorial, I still get the error:
Property 'updateEmployeeName' does not exist on type 'ContactFormComponent'
Typescript
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-contact-form',
templateUrl: './contact-form.component.html',
styleUrls: ['./contact-form.component.css']
})
export class ContactFormComponent {
employeeName= new FormControl('');
updateEmployeeName(){
this.employeeName.setValue('john');
}
}
HTML
<label>
Employee Name:
<input type="text" [formControl]="employeeName">
</label>