Skip to content

Instantly share code, notes, and snippets.

@twerske
Created May 5, 2022 22:37
Show Gist options
  • Save twerske/c06a9dcea9eee1f881d5d08551c8e873 to your computer and use it in GitHub Desktop.
Save twerske/c06a9dcea9eee1f881d5d08551c8e873 to your computer and use it in GitHub Desktop.
Angular v14 Typed Forms
const party = new FormGroup({
address: new FormGroup({
house: new FormControl(123),
street: new FormGroup({
name: new FormControl('Powell'),
kind: new FormControl('St'),
}),
}),
formal: new FormControl(true),
foodOptions: new FormArray([
new FormControl('Soup'),
])
});
const street = party.getRawValue().address.street.name;
party.patchValue({address: {house: 123}})party.patchValue({address: {house: 123}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment