Skip to content

Instantly share code, notes, and snippets.

@maximLyakhov
Created June 28, 2021 10:04
Show Gist options
  • Save maximLyakhov/f5f7cdc49dd0aef69dab8298cb558bcd to your computer and use it in GitHub Desktop.
Save maximLyakhov/f5f7cdc49dd0aef69dab8298cb558bcd to your computer and use it in GitHub Desktop.
get only updated fields from angular forms
const updatedFormValues = {};
this.form['_forEachChild']((control, name) => {
if (control.dirty) {
updatedFormValue[name] = control.value;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment