Skip to content

Instantly share code, notes, and snippets.

@rakia
Created March 9, 2020 22:10
Show Gist options
  • Select an option

  • Save rakia/5e4a9ad698f3cf6eb7972f81d5b03041 to your computer and use it in GitHub Desktop.

Select an option

Save rakia/5e4a9ad698f3cf6eb7972f81d5b03041 to your computer and use it in GitHub Desktop.
openTodoDialog(mode: string, todo?: TODO): void { // mode = 'create' | 'update'
const dialogRef = this.dialog.open(TodoDialog, {
width: '800px',
data: { mode: mode, todos: todo ? [todo] : [] }
});
dialogRef.afterClosed().subscribe((result: TODO[]) => {
if (result) {
this.todoService.updateTodoList(result, mode);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment