Skip to content
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

Why do the stackbliz examples not follow angular best practices? #1207

Open
IsaacSomething opened this issue Dec 23, 2022 · 1 comment
Open

Comments

@IsaacSomething
Copy link

Documentation Feedback

All of the stackbliz examples in the angular material documentation include one large root material file with all the components. So if someone is looking at the example for mat-menu, in the stackbliz example all of the components are loaded just for the mat-menu.

This goes against angular material best practices on feature modules and can easily lead to newbies adapting bad practices by following the example from the lead developers. The "correct way" is even outlined in your "Getting Started" guide, but not followed by the examples on stackbliz OR in the examples in the documentation.

IMHO the angular material documentation all seems a bit lazy (please see this as constructive) some of the code examples have private members with an underscore some of them dont, some of the examples have 2 components in one file (also against angular best practices). It all just seems really boring for a very cool UI/UX framework. Also, none of the examples use lazy loading which i a pretty sure is standard by now. Again, this is outlined in the guide but not the actual examples for each component, why? Why have a code examples when that code example is a bad outdated practice?

Some of the examples also seem to be be lacking. One good example for how bad it seems is the CDK overlay component. There is one example yet this module is so dynamic and allows the developer to really enhance a custom look and feel, yet im pretty sure most people will go to stackoverflow for most questions regarding setup of anything else other than open and close functionality, or even just use another module completely ( which i have seen a few times). The documentation talks about position and scroll strategies but it is never actually shown as code implementation. It is such a fun little module but it seems completely overlooked in the documentation, like it is an after thought.

Another is the Portal module. Such a awesome module, yet i know people who have been using material for years that dont even know about it. The portal module would also be such an amazing place to introduce newbies to token based injection in angular.

Affected documentation page

https://material.angular.io/cdk/overlay/examples

@amysorto amysorto transferred this issue from angular/components May 11, 2023
@kian23kpt
Copy link
Contributor

kian23kpt commented Jun 28, 2023

I think this issue was solved by adding standalone components.
in the mat-menu stackbliz example just MatMenuModule imported in ts file.
so this issue could be closed.
@amysorto @IsaacSomething

Screenshot from 2023-06-28 13-41-51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants