Angular 5 snack-bar Notifications

Developer picture Developer · Feb 8, 2018 · Viewed 18.6k times · Source

I want to implement notifications messages like

"Success! Your Details Added"
"Warning! Something Went Wrong"
"Danger! You don't have access to this"

i am already using angular material in my application can i use 'snack-bar' for notification purpose?

i also found some related toaster at npm

Suggest me if there is an another way to do this.

Answer

xeofus picture xeofus · Feb 8, 2018

I use this ngx-toastr, demo

  • Toast Component Injection without being passed ViewContainerRef
  • No use of *ngFor. Fewer dirty checks and higher performance.
  • AoT compilation and lazy loading compatible
  • Component inheritance for custom toasts
  • SystemJS/UMD rollup bundle
  • Animations using Angular's Web Animations API (polyfill needed for older devices)
  • Output toasts to an optional target directive