nebular icon indicating copy to clipboard operation
nebular copied to clipboard

`NbDialogService` has problem with `inputSignal` and `ModelSignal`

Open Akxe opened this issue 1 year ago • 1 comments

Issue type

I'm submitting a ...

  • [x] bug report
  • [ ] feature request

Issue description

Current behavior:

this.dialogService.open(OrderDetailComponent, {
	closeOnBackdropClick: false,
	context: {
		// Error: TS2322: Type 'Order' is not assignable to type 'InputSignal<Order> | undefined'
		data: data,
	},
});

Expected behavior: The input model should be updated, not tried to be replaced by new value

Steps to reproduce:

  1. Create a component with inputSignal (input.required());
  2. Open the component with context specifying our inputSignal

Related code:

@Component(...)
class MyDialogComponent {
  data = input.required<string>();
}

@Component(...)
class MyParentComponent {
  private readonly dialogService = inject(NbDialogService);


  onCreate(): void {
    this.dialogService.open(MyDialogComponent , {
      context: {
        data: 'test',
      },
    });
  }
}

Other information:

npm, node, OS, Browser

Node: v20.12.2
System: Win11

Angular, Nebular

Angular: 17
Nebular: 13

Akxe avatar May 29 '24 17:05 Akxe

Can the PR be reviewed and merged, would be nice if we could use the new Signal input for dialogs!

jkneepkens avatar Mar 26 '25 14:03 jkneepkens