ts 파일에 FormBuilder, FormGroup, FormControl을 직접 선언하여 사용하지 않고 간단하게 전송 테스트를 진행할 수 있다.
// html
<div>
<div>
<form #authForm="ngForm" (ngSubmit)="onSubmit(authForm)">
<div>
<label for="email">E-mail</label>
<input type="email" id="email" ngModel name="email" required email>
</div>
<div>
<label for="password"></label>
<input type="password" id="password" ngModel name="password" required minlength="6">
</div>
<div>
<button type="submit" [disabled]="!authForm.valid">Submit</button>
</div>
</form>
</div>
</div>
// ts
onSubmit(form: NgForm): void {
console.log(form.value); // {email: '', password: ''}
form.reset();
}