Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing Context to NbDialog Component #1173

Closed
1 of 2 tasks
sasikumardr opened this issue Jan 22, 2019 · 1 comment
Closed
1 of 2 tasks

Passing Context to NbDialog Component #1173

sasikumardr opened this issue Jan 22, 2019 · 1 comment

Comments

@sasikumardr
Copy link
Contributor

sasikumardr commented Jan 22, 2019

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request

Issue description

Current behavior:

When passing component as first parameter in NbDialogService.open, I am not able to provide certain properties of component in context property of NbDialogConfig. Typescript complaints that other properties and methods of component are missing in the context.

Expected behavior:

We should be able to pass certain component properties in context

Steps to reproduce:

please check this file in stackblitz
https://stackblitz.com/edit/github-id5yop?file=src%2Fapp%2Fhome%2Fhome.component.ts

Proposed Fix:

in src/framework/theme/components/dialog/dialog.service.ts

From

open<T>(content: Type<T> | TemplateRef<T>, userConfig: Partial<NbDialogConfig<T>> = {}): NbDialogRef<T> {

To (use Partial of dialog Component in userConfig property)

open<T>(content: Type<T> | TemplateRef<T>, userConfig: Partial<NbDialogConfig<Partial<T>>> = {}): NbDialogRef<T> {
@sasikumardr
Copy link
Contributor Author

Hi @nnixaa, fix for this appears to be a single line change as shown in the PR. Could we include this in 3.2 milestone? Currently I am using this in one of my development project and using dirty hack on d.ts in node-modules for making the error free for typescript. So far everything worked fine here.

If there is more for this fix please let me know. I'll look in to it.

@nnixaa nnixaa added the Sprint label Feb 15, 2019
@nnixaa nnixaa closed this as completed in 9a5f4d9 Feb 18, 2019
@yggg yggg modified the milestones: 3.4.0, 3.3.0 Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants