Skip to content

[Dialog] Example is broken due to autogenerated module #8750

Closed
@richardstangl

Description

@richardstangl

Bug, feature request, or proposal:

In the stackblitz for mat-dialog, the dialog-content-example-dialog component does not use the selector <dialog-content-example-dialog> and causes "Error: The selector "dialog-content-example-dialog" did not match any elements at...". Following the example in my own project causes the same error.

When I add the selector to the html, it causes "Unhandled Promise rejection: StaticInjectorError[MatDialogRef]: StaticInjectorError[MatDialogRef]: NullInjectorError: No provider for MatDialogRef!

What is the expected behavior?

No errors when using mat-dialog as described in the stackblitz.

What is the current behavior?

Errors when following the example.

What are the steps to reproduce?

Just open the stackblitz and look at the console.
https://stackblitz.com/angular/dgjvllndexp?file=app%2Fdialog-content-example.html

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

Avoiding errors

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

I'm using Angular 5.0.1, Material 5.0.0-rc0, Typescript 2.4.2, latest version of Chrome (Version 62.0.3202.94)

Is there anything else we should know?

I'm still learning Angular 2+ and Material2 so I may just be missing something obvious.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions