Skip to content

ERROR Error: No provider for Token MdDialogData! #4086

Closed
@kelsmj

Description

@kelsmj

Bug, feature request, or proposal:

As of 2.0.0-beta.3, you need to inject the MD_DIALOG_DATA token in order to access the data property of the MdDialogConfig object. If you inject the MD_DIALOG_DATA token into a component that will be loaded into the dialog, and you do not pass data in, you will get

Error: No provider for Token MdDialogData!

What is the expected behavior?

Do not throw an error and to return an empty object if none is passed in.

What is the current behavior?

Error: No provider for Token MdDialogData!

What are the steps to reproduce?

Plunker

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

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

Angular Material 2.0.0-beta.3
Angular 4.00

Is there anything else we should know?

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions