Components: Add info about entryComponents in Dialog documentation

Created on 17 Jan 2017  路  4Comments  路  Source: angular/components

Bug, feature request, or proposal:

Proposal

What is the expected behavior?

It should be easy to follow the dialog overview sample and get it up and running using a new app created with Angular CLI.

What is the current behavior?

I was struggling with getting the Dialog component to work without showing errors in the console. I finally solved it by adding my DialogContentComponent to the module鈥檚 _entryComponents_. It would be helpful if there was a section in the documentation if this is a requirement.

What are the steps to reproduce?

The steps to reproduce the errors in the console is available from:
https://github.com/coder925/sample-angular-material-dialog-overview#sample-angular-material-dialog-overview

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

It would improve the documentation if this is a requirement and help other people who might struggle with the same issue.

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

https://github.com/coder925/sample-angular-material-dialog-overview#versions

Is there anything else we should know?

I can submit a PR for improved documentation. However, I am afraid my knowledge regarding why you must place the _content dialog component_ in _entryComponents_ is not sufficient to be able to describe the reasons for this requirement correctly.
The Plunkr sample of the Dialog Overview places the content dialog component in the module鈥檚 bootstrap instead. I was not able to get this to work.

P1 docs in progress

Most helpful comment

What also should be made clear is whether it should be added to:

  • entryComponents of the module the component belongs to
  • entryComponents of the module that contains the actual call to dialog.open() - as this could be a different module than the above-mentioned module
  • entryComponents of the root "App" module
  • All of the above (?)

I'm actually still not clear myself on which it is to be honest.

All 4 comments

I see that the requirement of _entryComponents_ is mentioned in the README of the Dialog. So my proposal is merely to also include this information on https://material.angular.io/components/component/dialog . Thanks!

Yep, looks like that information was accidentally lost in the transition from readme to overview.

What also should be made clear is whether it should be added to:

  • entryComponents of the module the component belongs to
  • entryComponents of the module that contains the actual call to dialog.open() - as this could be a different module than the above-mentioned module
  • entryComponents of the root "App" module
  • All of the above (?)

I'm actually still not clear myself on which it is to be honest.

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._

Was this page helpful?
0 / 5 - 0 ratings