MatSnackBarConfig.viewContainerRef is not honored
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
When MatSnackBar.open
is called with a MatSnackBarConfig
like
{
...
viewContainerRef: myContainerRef
...
}
according to the documentation:
viewContainerRef: ViewContainerRef The view container to place the overlay for the snack bar into.
it’s overlay of the snackbar should be placed inside the provided container ref.
What is the current behavior?
It’s attached directly to <body>
What are the steps to reproduce?
https://stackblitz.com/edit/angular-material2-issue-1jgbvq
What is the use-case or motivation for changing an existing behavior?
I want to show the snackbar inside of a container and not globally
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular: 5.2.9 Material: 5.2.5 OS: MacOS v10.13.3 TypeScript: 2.4.2 Browser: Chrome v65.0.3325.181
Is there anything else we should know?
Nope
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Is it possible to open angular/Material2 Snackbar on especific ...
Yes. The viewContainerRef property of MatSnackBarConfig will accept a ViewContainer to use as a place ...
Read more >Snackbar - Angular Material
open. Opens a snackbar with a message and an optional action. Parameters. message. string. The message to show in the snackbar. action. string...
Read more >Open snackbar into a specific container? - Google Groups
I'm working on a dashboard app where each view may have several components. ... I am admittedly not well versed with view container...
Read more >base-with-mat - UNPKG
If the tabs are not ready yet, we assume that the user is\n * providing a valid ... false;\n\n constructor(private _viewContainerRef: ViewContainerRef) {\n ......
Read more >Falcon Sandbox v8.30 © Hybrid Analysis
Not all malicious and suspicious indicators are displayed. ... Uses a User Agent typical for browsers, although no browser was ever launched.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@josephperrott Can you at least update the ambiguous documentation? Because the documentation says the place in the logic tree, it says ‘The view container to place the overlay for the snack bar into.’ And that’s totally not happening.
@josephperrott I would vote for a documentation change as well. Got fooled by the current documentation as well.