Skip to content

Commit 688f98f

Browse files
committed
Fix FormBuilder examples
1 parent c5be41c commit 688f98f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ng-forms/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ <h3>FormBuilder</h3>
105105

106106
@Component({ ... })
107107
export class FormTestComponent implements OnInit {
108-
contactForm: FormGroup;
108+
contactForm: FormGroup<ContactFormType>;
109109

110110
constructor(private formBuilder: FormBuilder) { }
111111

112112
ngOnInit(): void {
113113
contactForm = this.formBuilder.group({
114-
name: {
114+
name: this.formBuilder.group({
115115
first: "Juana",
116116
last: "Garcia",
117-
},
117+
}),
118118
email: "",
119119
});
120120
}
@@ -124,10 +124,10 @@ <h3>FormBuilder</h3>
124124
<h3>Validation</h3>
125125
<p>... in Model Driven forms</p>
126126
<pre><code class="typescript"> this.contactForm = this.formBuilder.group({
127-
name: {
127+
name: this.formBuilder.group({
128128
first: "Juana",
129129
last: ["Garcia", Validators.required],
130-
},
130+
}),
131131
email: ["", Validators.email],
132132
});</code></pre>
133133
<ul>

0 commit comments

Comments
 (0)