diff --git a/apps/baseline/README.md b/apps/baseline/README.md index 31cf8f7..5e05a5c 100644 --- a/apps/baseline/README.md +++ b/apps/baseline/README.md @@ -3,6 +3,11 @@ The easiest way to create a simple Reactive Form is to use a single Angular component to build and display the form. In this example application, an asynchronous call to an API is simulated. The `Contact` object thus obtained is used to create and initialize a `FormGroup` using the Angular `FormBuilder`. ```typescript +export class AppComponent implements OnInit, OnDestroy { + form: FormGroup; + + private subscription: Subscription; + public ngOnInit() { this.subscription = this.service .loadContact() @@ -47,6 +52,7 @@ The easiest way to create a simple Reactive Form is to use a single Angular comp get addresses(): FormArray { return this.form.get('addresses') as FormArray; } +} ``` The component's template remders input controls for the Contact's name, and iterates over the array of addresses to render controls to edit each one.