-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snack-bar #65
Comments
Hmm may look into it, haven't really used material snackbar before, I guess it can have something to do with the layout and being all wraped in side menu wrapper ? |
@DevJoseWeb please provide more code- e.g. it's not obvious from above if you are correctly injecting MdSnackBar instance into your component and I'm not so sure about the AppComponent part of: this.snackBar.openFromComponent(AppComponent ... |
@DevJoseWeb I don't have time to clone/fork/pull request etc but here is a solution- it's the src dir zipped and contains a shared-snack component added to the shared module as an entryComponent. I then inject the snackbar ref into the constructor: which gets called from: In some projects I have worked on with ngrx, we have a layout slice in the store and the open/close snackbar are actions on the store but that's a different story... |
Ok, so I added snack-bar notification to todos example, feel free to check it! That being said, I personally find snack-bar pretty lacking compared to full-fledged notification system with stuff like severity etc... I might add centralized notification service later... |
I'm trying to extend a notification system using a snack bar on your project, but without success, do you have any tips?
import { MatExpansionModule } from '@angular/material/expansion'; import { MatSnackBarModule } from '@angular/material/snack-bar';
openSnackBar() { this.snackBar.openFromComponent(AppComponent, { duration: 900, }); }
<button mat-button (click)="openSnackBar()" aria-label="Show an example snack-bar"> Button </button>
The text was updated successfully, but these errors were encountered: