WIP multi error messages
parent
89089959af
commit
419b0bf70a
@ -0,0 +1,5 @@
|
|||||||
|
<h1 mat-dialog-title>Dialog with elements</h1>
|
||||||
|
<div mat-dialog-content>This dialog showcases the title, close, content and actions elements.</div>
|
||||||
|
<div mat-dialog-actions>
|
||||||
|
<button mat-button mat-dialog-close>Close</button>
|
||||||
|
</div>
|
@ -0,0 +1,35 @@
|
|||||||
|
import { Component, Inject } from '@angular/core';
|
||||||
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
import { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-error-snackbar',
|
||||||
|
template: `
|
||||||
|
<p>{{ data.message }}</p>
|
||||||
|
<button mat-raised-button
|
||||||
|
color="accent"
|
||||||
|
(click)="actionAndDismiss()">{{ data.action }}</button>
|
||||||
|
`,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
export class ErrorSnackbarComponent {
|
||||||
|
constructor(
|
||||||
|
public snackBarRef: MatSnackBarRef<ErrorSnackbarComponent>,
|
||||||
|
public dialog: MatDialog,
|
||||||
|
@Inject(MAT_SNACK_BAR_DATA) public data: any,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
|
||||||
|
public actionAndDismiss(){
|
||||||
|
console.log("test");
|
||||||
|
this.dialog.open(SnackbarDialog);
|
||||||
|
this.snackBarRef.dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-snackbar-dialog',
|
||||||
|
templateUrl: 'snackbar-dialog.html',
|
||||||
|
})
|
||||||
|
export class SnackbarDialog {}
|
Loading…
Reference in New Issue