Migrating angular-toastr / toastr to modern Angular
angular-toastr showed success, error and warning toasts from anywhere through an injected service.
What replaces it
| Option | When to choose it |
|---|---|
| ngx-toastr | Same concept and options; the quickest swap. |
| MatSnackBar | When you use Angular Material. |
| Your own service with CDK Overlay | When notifications are part of your design system. |
How to migrate it
- Wrap notifications in your own NotificationService so components never call the library directly.
- Downgrade that service and switch the legacy code to it.
- Swap the implementation underneath once, for both frameworks.
Watch out. This is a good first migration: small, visible and low risk. It also proves that a downgraded service works in your hybrid setup.
Other libraries
Planning a migration or a micro-frontend platform?
In a 20-minute call you describe your situation and I tell you how I'd approach it. If it isn't worth doing yet, I'll say so.
Message me on LinkedIn