Skip to content

Document NgModule dependencies for components #15340

@JoeKahl

Description

@JoeKahl

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?

"@angular/animations": "^7.2.1",
"@angular/cdk": "^7.2.1",
"@angular/common": "^7.2.1",
"@angular/core": "^7.2.1",
"@angular/forms": "^7.2.1",
"@angular/http": "^7.2.1",
"@angular/language-service": "^7.2.1",
"@angular/material": "^7.2.1",
"@angular/platform-browser": "^7.2.1",
"@angular/platform-browser-dynamic": "^7.2.1",
"@angular/router": "^7.2.1",

Is there anything else we should know?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: manyArea label for issues related to many componentsarea: material.angular.iodocsThis issue is related to documentationhelp wantedThe team would appreciate a PR from the community to address this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions