Mohammad Fareed
Mohammad Fareed

Reputation: 1972

Angular 5 snack-bar Notifications

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.

Upvotes: 10

Views: 21194

Answers (4)

Mohammad Fareed
Mohammad Fareed

Reputation: 1972

empower your application with a personalized touch by crafting a bespoke component to elegantly showcase your messages.

Alternatively, consider the brilliance of SweetAlert2, a feature-rich library offering an array of functionalities and events, providing unparalleled control over your notification experiences.

Upvotes: 0

Ashraful Islam
Ashraful Islam

Reputation: 1263

Though you are using angular material so its better to use snack-bar of angular material.

If you want to look for other options then you can also use growl of primeng or message of primeng

You can also write custom code for showing this kind of message you want. But in that case you have to control externally a lot of things like position of that message, timing, dismissing etc

So the choice is absolutely yours.

Upvotes: 6

Zoha Irshad
Zoha Irshad

Reputation: 467

For notifications you can use angular2-notifications.

For toaster you can use angular2-toaster.

Upvotes: 5

xeofus
xeofus

Reputation: 774

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

Upvotes: 12

Related Questions