@angular/material/snack-bar#MatSnackBarConfig TypeScript Examples
The following examples show how to use
@angular/material/snack-bar#MatSnackBarConfig.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: client.service.ts From App with MIT License | 5 votes |
openSnackBar(message: string, action: string, opt?: MatSnackBarConfig): void {
this.snackBar.open(message, action, {
duration: 5000,
...opt ?? {}
});
}
Example #2
Source File: notification.service.ts From enterprise-ng-2020-workshop with MIT License | 5 votes |
private show(message: string, configuration: MatSnackBarConfig) {
// Need to open snackBar from Angular zone to prevent issues with its position per
// https://stackoverflow.com/questions/50101912/snackbar-position-wrong-when-use-errorhandler-in-angular-5-and-material
this.zone.run(() => this.snackBar.open(message, null, configuration));
}