Skip to content

docs-bug(Sidenav): stackblitz example not loading #30307

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

Closed
SpeederX opened this issue Jan 11, 2025 · 5 comments
Closed

docs-bug(Sidenav): stackblitz example not loading #30307

SpeederX opened this issue Jan 11, 2025 · 5 comments
Labels
area: material/sidenav docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@SpeederX
Copy link

Documentation Feedback

Hi!

Context:
I was having a look at Sidenav example page and I stumbled upon this bug while loading the Stackblitz. Basically the example doesn't load the content as it triggers a Nullinjector for ActivatedRoute from the console log trace.

Proposed solution
After some try I noticed that giving provideRouter([]) in the main.ts would fix the problem.

From my understanding in angular/components, the setup is provided from this file.
angular/components/.../material.angular.io/src/assets/stack-blitz/src/main.ts
I think this solution might affect also other example environment for stackblitz in general, so I'm asking if this can be achieved this way without messing other things or there are other possible solution that would not affect as much.

This is the first issue I open here and I was wondering if this can be open to contribution also.

Affected documentation page

https://material.angular.io/components/sidenav/overview#creating-a-responsive-layout-for-mobile--desktop

@SpeederX SpeederX added docs This issue is related to documentation needs triage This issue needs to be triaged by the team labels Jan 11, 2025
@crisbeto
Copy link
Member

I think we should just remove the router link from the example since it isn't serving any documentation purposes.

@SpeederX
Copy link
Author

Didn't think it was just that.. amazing. Can I do that with a PR?

@crisbeto
Copy link
Member

Yep, feel free to send a PR.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/sidenav and removed needs triage This issue needs to be triaged by the team labels Jan 12, 2025
naaajii added a commit to naaajii/components that referenced this issue Jan 25, 2025
fixes broken example for responsive sidebar which included routerLink directive but is missing router module which prevents sidebar from opening by removing directive as it serve no purpose

fixes angular#30307
@wagnermaciel
Copy link
Contributor

Fixed by 71865c7

wagnermaciel pushed a commit to wagnermaciel/components that referenced this issue Jan 27, 2025
fixes broken example for responsive sidebar which included routerLink directive but is missing router module which prevents sidebar from opening by removing directive as it serve no purpose

fixes angular#30307
wagnermaciel added a commit that referenced this issue Jan 27, 2025
fixes broken example for responsive sidebar which included routerLink directive but is missing router module which prevents sidebar from opening by removing directive as it serve no purpose

fixes #30307

Co-authored-by: Naji <[email protected]>
angular-robot pushed a commit to angular-robot/components that referenced this issue Jan 27, 2025
fixes broken example for responsive sidebar which included routerLink directive but is missing router module which prevents sidebar from opening by removing directive as it serve no purpose

fixes angular#30307
@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 Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/sidenav docs This issue is related to documentation P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants