Skip to content

Instantly share code, notes, and snippets.

@alex-okrushko
Last active December 13, 2018 03:29
Show Gist options
  • Select an option

  • Save alex-okrushko/c2f688e96c562a0d6d7500fe34bc1df3 to your computer and use it in GitHub Desktop.

Select an option

Save alex-okrushko/c2f688e96c562a0d6d7500fe34bc1df3 to your computer and use it in GitHub Desktop.
@Component({
templateUrl: './add_comment_dialog.ng.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AddCommentDialog {
comment: FormControl;
constructor(
readonly dialogRef: MatDialogRef<AddCommentDialog>,
@Optional() @Inject(MAT_DIALOG_DATA) readonly errorPayload?:
AddCommentErrorPayload,
) {
this.comment = new FormControl('', [Validators.required]);
if (this.errorPayload) {
this.comment.setValue(this.errorPayload.errorComment);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment