Skip to content

Commit 9098c12

Browse files
committed
add touch after adding to trigger form validation
1 parent 294324c commit 9098c12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/fizz-buzz/fizz-buzz.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export class FizzBuzzComponent {
4444
wordToPrint: new FormControl<string>('Buzz', {nonNullable: true}),
4545
})
4646
);
47+
this.formGroup.markAllAsTouched();
4748
}
4849

4950
protected onRemove(group: FormGroup<any>) {
@@ -52,7 +53,7 @@ export class FizzBuzzComponent {
5253

5354
protected onSubmit() {
5455
this.formGroup.markAllAsTouched();
55-
56+
5657
const multiples = this.formGroup.controls.multiples.controls.map((group) => {
5758
return {
5859
multiple: group.controls.multiple.value,

0 commit comments

Comments
 (0)