Closed JoeKahl closed 4 hours ago
This is one of the first complaints I hear from developers new to Material. StackBlitz examples tend to include all modules, making it harder to find out exactly what's needed.
The documentation is definitely one of the biggest hurdles which was putting me off Angular & Angular Material, we always need to search further to find out why something really isn't working even if the code is exactly the same as given in the docs... add to that breaking changes that aren't communicated to devs in an accessible & clear way (or even have proper error messages).
(revisiting older issues as part of a triaging fix-it)
This is a good point; we should explicitly document the NgModule
dependencies for the different components.
@crisbeto @jelbourn I would like to help solving this issue, what do you think about adding the NgModule dependencies in this way?
Let me know if you like that desing, or what could be better, so I can start to work on it :)
I would probably do something that takes up less vertical space, more formatted roughly like
## API Reference for...
`import ...`
Depends on `FormsModule`, ...
Closing this issue since examples now use standalone components where imports are more clear instead of importing a common material module like before.
What is the expected behavior?
When following component examples, such as autocomplete, the only module mentioned as a dependency is MatAutocompleteModule. But in order to get the example code to work I also have to add FormsModule, MatInputModule, MatSelectModule and ReactiveFormsModule.
What is the current behavior?
Currently not all module dependencies are listed for examples. This wastes my time. Some of these dependencies do not give a compiler nor a run time error. The missing dependencies just make the code not work. I spend a lot of time reverting my work, going back to the example, as literally as I can. Eventually I get lucky and get an error message that leads to one missing dependency, then another. This process is not productive. Please consider listing all of the module dependencies for your examples.
What are the steps to reproduce?
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?