Skip to content

[Dialog] missing generic for MatDialogRef result type in open method #11052

@RKaczmarek

Description

@RKaczmarek

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Should be able to define MatDialogRef result type in open method.

open<T, D = any, R = any>(componentOrTemplateRef: ComponentType<T> | TemplateRef<T>, config?: MatDialogConfig<D>): MatDialogRef<T, R>

What is the current behavior?

open<T, D = any> only allows setting componentOrTemplateRef component type and data input type.

open<T, D = any>(componentOrTemplateRef: ComponentType<T> | TemplateRef<T>, config?: MatDialogConfig<D>): MatDialogRef<T>

R is missing, therefore result is always any.

What are the steps to reproduce?

What is the use-case or motivation for changing an existing behavior?

Prevent from setting the type on every afterClosed() call.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

angular 5,
mat2

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions