<code-exampleheader="Submit method in src/app/housing.service.ts"path="first-app-lesson-12/src/app/housing.service.ts"region="submit-method"></code-example>
1. Confirm that the app builds without error.
Correct any errors before you continue to the next step.
<code-exampleheader="Forms imports in src/app/details/details.component.ts"path="first-app-lesson-12/src/app/details/details.component.ts"region="form-imports"></code-example>
<code-exampleheader="imports directive in src/app/details/details.component.ts"path="first-app-lesson-12/src/app/details/details.component.ts"region="component-imports"></code-example>
1. In the `DetailsComponent` class, before the `constructor()` method, add the following code to create the form object.
<code-exampleheader="template directive in src/app/details/details.component.ts"path="first-app-lesson-12/src/app/details/details.component.ts"region="form-code"></code-example>
In Angular, `FormGroup` and `FormControl` are types that enable you to build forms. The `FormControl` type can provide a default value and shape the form data. In this example `firstName` is a `string` and the default value is empty string.
1. In the `DetailsComponent` class, after the `constructor()` method, add the following code to handle the **Apply now** click.
<code-exampleheader="template directive in src/app/details/details.component.ts"path="first-app-lesson-12/src/app/details/details.component.ts"region="form-submit"></code-example>
This button does not exist yet - you will add it in the next step. In the above code, the `FormControl`s may return `null`. This code uses the nullish coalescing operator to default to empty string if the value is `null`.
<code-exampleheader="template directive in src/app/details/details.component.ts"path="first-app-lesson-12/src/app/details/details.component.ts"region="component-template"></code-example>
The template now includes an event handler `(submit)="submitApplication()"`. Angular uses parentheses syntax around the event name to define events in the template code. The code on the right hand side of the equals sign is the code that should be executed when this event is triggered. You can bind to browser events and custom events.