Components: snackbar - why is `ViewContainerRef` required

Created on 3 Oct 2016  路  2Comments  路  Source: angular/components

Honestly why? Can't it use root component's ViewContainerRef by default? Sure, when you are making a demo and triggering the snackbar from a component upon a button click, getting hold of ViewContainerRef is easy. But you know, in real life, you are probably going to be triggering it from a service, or an effect, and there's no easy way to get hold of any ViewContainerRef there, making snackbar extremely annoying to use.

Most helpful comment

But you know, in real life, you are probably going to be triggering it from a service, or an effect, and there's no easy way to get hold of any ViewContainerRef there

We don't have a way of getting access to one either. See https://github.com/angular/angular/issues/9293

I'm trying to get support for this added to core before Material gets to beta.

All 2 comments

But you know, in real life, you are probably going to be triggering it from a service, or an effect, and there's no easy way to get hold of any ViewContainerRef there

We don't have a way of getting access to one either. See https://github.com/angular/angular/issues/9293

I'm trying to get support for this added to core before Material gets to beta.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vitaly-t picture vitaly-t  路  3Comments

LoganDupont picture LoganDupont  路  3Comments

MurhafSousli picture MurhafSousli  路  3Comments

xtianus79 picture xtianus79  路  3Comments

alanpurple picture alanpurple  路  3Comments