Angular-material MatSnackBar default duration time

Discussão em 'Angular' iniciado por Udi Mazor, Abril 6, 2025.

  1. Udi Mazor

    Udi Mazor Guest

    Our team is using the MatSnackBar of the Angular Material in the application. Because every one is in charge of different pages there are different durations times of the snackBars of each page. Some set the duration to 2000ms, others to 1000ms and some even made it 3000ms.

    I want to get the duration value from a single variable so I can control the duration for all snackBars in one place. Maybe even to dismiss the developers from sending a duration value when calling the snackBar.open function.

    this.snackBar.open(message, {
    duration: 2000,
    });


    What is the best way for it?

    Continue reading...

Compartilhe esta Página