diff --git a/docs/forms.md b/docs/forms.md index e69de29..aa1cc09 100644 --- a/docs/forms.md +++ b/docs/forms.md @@ -0,0 +1,252 @@ +# Forms + +Angular offers two different approach to retrieving data from a from. +- Template-driven (predefined) +- Reactive (Manual setup but flexible) + +## Template driven +### Creating the Form and registering the controls + +Import the Form module in the `app.module.ts`. + +```ts +import { FormsModule } from '@angular/forms'; + +@NgModules({ + imports: [ FormsModule ] +}) +``` + +Register the imput with the `ngModel` directive. + + + +### Submitting and using the Form + +app.component.html +```html +