Browse Source

feat(lib): destructure parameters

pull/6305/head
Kenrick Tandrian 2 months ago
parent
commit
b089b0c6c5
  1. 20
      libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts

20
libs/ui/src/lib/notifications/prompt-dialog/prompt-dialog.component.ts

@ -29,12 +29,18 @@ export class GfPromptDialogComponent {
protected readonly dialogRef = protected readonly dialogRef =
inject<MatDialogRef<GfPromptDialogComponent>>(MatDialogRef); inject<MatDialogRef<GfPromptDialogComponent>>(MatDialogRef);
public initialize(aParams: PromptDialogParams) { public initialize({
this.confirmLabel = aParams.confirmLabel; confirmLabel,
this.defaultValue = aParams.defaultValue; defaultValue,
this.discardLabel = aParams.discardLabel; discardLabel,
this.formControl.setValue(aParams.defaultValue ?? null); title,
this.title = aParams.title; valueLabel
this.valueLabel = aParams.valueLabel; }: PromptDialogParams) {
this.confirmLabel = confirmLabel;
this.defaultValue = defaultValue;
this.discardLabel = discardLabel;
this.formControl.setValue(defaultValue ?? null);
this.title = title;
this.valueLabel = valueLabel;
} }
} }

Loading…
Cancel
Save