Skip to content

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

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

Closed
richardstangl opened this issue Nov 30, 2017 · 5 comments
Closed

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

richardstangl opened this issue Nov 30, 2017 · 5 comments
Assignees
Labels
docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@richardstangl
Copy link

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.

@rodschulz
Copy link

I'm facing the exact same issue.

In order to get the dialog to work it has to be put in the bootstrap section, in the app module declaration. I'm guessing that, since the dialog selector is not explicitly written anywhere, then the error.

@rodschulz
Copy link

Found a fix for this in this issue. I tried the solution and it worked for me.

@andrewseguin andrewseguin changed the title Mat-dialog component does not use selector in DOM, causes "The selector [...] does not match any elements" error [Dialog] Example is broken due to autogenerated module Dec 12, 2017
@jelbourn jelbourn assigned amcdnl and unassigned jelbourn Dec 12, 2017
@jelbourn jelbourn added docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Dec 12, 2017
@amcdnl
Copy link
Contributor

amcdnl commented Dec 16, 2017

Fixed here - angular/material.angular.io#356

@amcdnl amcdnl added the has pr label Dec 16, 2017
@crisbeto
Copy link
Member

crisbeto commented Sep 6, 2018

Looks like this has been fixed.

@crisbeto crisbeto closed this as completed Sep 6, 2018
andrewseguin pushed a commit to andrewseguin/components that referenced this issue Oct 15, 2018

Verified

This commit was signed with the committer’s verified signature. The key has expired.
chrischdi Christian Schlotter
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

5 participants