Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Last active June 17, 2019 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/da740a94184c804877969b81f63a7f7e to your computer and use it in GitHub Desktop.
Save gavilanch/da740a94184c804877969b81f63a7f7e to your computer and use it in GitHub Desktop.
ngOnInit() {
this.todoForm = this.formBuilder.group({
title: ['', Validators.required],
description: ['', Validators.required],
done: false
});
if (!this.createMode) { this.loadTodo(this.todo); }
}
loadTodo(todo) {
this.todoForm.patchValue(todo);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment