1

In order to not always specify the same options when opening a snackbar, I am looking into possible ways to provide default values. For the duration I already found a way to specify a default value via MAT_SNACK_BAR_DEFAULT_OPTIONS (see https://stackoverflow.com/a/51022568/11425760).

Is there a way to achieve something similar for the button label, so I do not always have to specify it again when opening a snackbar? To clarify, I am talking about the second argument where I pass OK in this example:

this.snackBar.open('Text', 'OK');
Chris
  • 1,417
  • 4
  • 21
  • 53
  • You should try this: https://stackoverflow.com/questions/53950143/how-to-put-the-action-button-when-using-the-snackbar-openfromcomponent-metho – Besartt Sep 25 '22 at 12:33

0 Answers0