Skip to content

docs: update documentation on creating a custom material module #15229

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

Merged
merged 1 commit into from
Feb 22, 2019

Conversation

ahasall
Copy link
Contributor

@ahasall ahasall commented Feb 18, 2019

This PR improves the precision of the documentation on creating our own custom Material NgModule.

The only requirement for this NgModule is to export Angular Material modules. Currently the documentation puts the focus on importing the Material modules.

While importing the Material modules in MyOwnCustomMaterialModule doesn't do any harm it's not necessary.

What do you think?

@ahasall ahasall requested a review from jelbourn as a code owner February 18, 2019 21:26
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 18, 2019
@@ -82,16 +82,15 @@ import {MatButtonModule, MatCheckboxModule} from '@angular/material';
export class PizzaPartyAppModule { }
```

Alternatively, you can create a separate NgModule that imports all of the
Alternatively, you can create a separate NgModule that exports all of the
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. But personally, especially for newcomers, it might be better to also leave the imports statement as well. Usually where this importing/exporting happens is your SharedModule, where you most probably have also a bunch of other stuff that you'd like to re-export + you might even have shared components there, using things from Angular Material, and thus the import would be required again.

So for simplicity, I'd nearly suggest changing it slightly to

"Alternatively, you can create a separate NgModule that imports and then re-exports all of the Anguar Material components that you will use in your application. By exporting them again, other modules can simply include our MyOwnCustomMaterialModule wherever Material components are needed and automatically get all of the exported Material modules. A good place for importing/exporting the application-wide Material modules is the SharedModule."

Something like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't have said this any better.

@ahasall ahasall force-pushed the custom-mat-module-doc branch from b5bfcf3 to 236fadd Compare February 19, 2019 17:54
@ahasall ahasall force-pushed the custom-mat-module-doc branch from 236fadd to eb0df39 Compare February 19, 2019 17:56
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm docs This issue is related to documentation action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Feb 19, 2019
@jelbourn jelbourn merged commit 5d3f515 into angular:master Feb 22, 2019
@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 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement docs This issue is related to documentation target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants