-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Error: The selector (...) did not match any elements #5899
Comments
@Bartosz-D3V, just correcting the link to plunk: https://plnkr.co/edit/F6O5ltdCJrVn3r2qw4DU?p=preview |
@julianobrasil, thank you. I have just edited my comment to reflect this change. |
The problem is the Dialog being bootstraped along with the main component (probably copy-and-paste effect):
It should be just:
Fixed plunk: https://plnkr.co/edit/JhJkK4a9adQOyIgWXpWy?p=preview |
@julianobrasil, I have just checked your Plunker, it looks perfect 👍 . entryComponents: [DialogResultExampleDialog], Just like you did. |
The issue stems from the The selectors contains the name of both components for the example, in the case of a dialog its both the root and the dialog component. https://github.com/angular/material2/blob/38b4265704c7147ff609002f7704ddf11250a9ba/src/material-examples/example-module.ts#L141 . This seems to be the case before and after the automatic example module generation as the referenced file pre-dates automatic module generation. The This results is that its replaced with both components in the I'm not sure how this ever worked for Dialogs as none of these files have changed recently. |
@amcdnl It has been broken for a few months at least and AFAIK it has never worked |
Should be resolved in this PR to material.angular.io repo: angular/material.angular.io#228 |
Should be resolved per that PR linked |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Example code snippet in the official Angular Material documentation should not throw any error.
What is the current behavior?
When running example Plunker code related to Modals, Angular throws an error:
'Error: The selector "dialog-result-example-dialog" did not match any elements'
What are the steps to reproduce?
Open this Plunker code:
https://plnkr.co/edit/F6O5ltdCJrVn3r2qw4DU?p=preview
And then open a console from debugging tools after the application will load.
What is the use-case or motivation for changing an existing behavior?
Application throws an error, although the modal window is opening correctly.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular Material: 2.0.0-beta.8
Is there anything else we should know?
URL of the Plunker example comes from official Angular Material documentation for Modals:
https://material.angular.io/components/dialog/examples
The text was updated successfully, but these errors were encountered: