# Template-Driven Forms — Angular

Source: https://www.geekswithgeeks.com/en/angular/ng-template-driven-forms

> Build simple forms mostly in the template with ngModel.

## A basic form

`ngModel` on each field builds up the form's value; `ngSubmit` fires when the form is submitted.

```html
<form #f="ngForm" (ngSubmit)="onSubmit(f.value)">
  <input name="email" [(ngModel)]="email" required>
  <button type="submit">Sign up</button>
</form>
```

## Good for simple cases

Template-driven forms suit short, simple forms. Angular manages the form model behind the scenes, so there's less TypeScript to write.
