Skip to content

NbDialogService has problem with inputSignal and ModelSignal #3256

Open
@Akxe

Description

@Akxe

Issue type

I'm submitting a ...

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions