How to inject snackBarRef into a component with openFromComponent
问题 The latest Material documentation says the following.. If you want to close a custom snack-bar that was opened via openFromComponent, from within the component itself, you can inject the MatSnackBarRef. but they don't show you how to do it. In their example, they nest a component within the same .ts file as the calling module, and they don't show the ref being passed in. But since I want to use a more centralized approach, I have created a new module using... ng g component components