Closed
Description
I use snack-bar to show notifications. I want to change background color when the response is: error (background: red) or success(background : green).
Code:
let config = new MdSnackBarConfig();
config.duration = 500;
snackBarRef = this.snackBar.open("Message", "", config);
snackBarRef.afterOpened().subscribe(()=>{ });
snackBarRef.afterDismissed().subscribe(()=>{ });
I tried to use:
let snackContainer = document.getElementById("cdk-overlay-0");
snackContainer.firstElementChild.setAttribute("style","background-color:red");
but the snack-bar disappear.
Metadata
Metadata
Assignees
Labels
No labels