Carlos Cifuentes
AngularJS library migration · notifications

Migrating angular-toastr / toastr to modern Angular

angular-toastr showed success, error and warning toasts from anywhere through an injected service.

What replaces it

OptionWhen to choose it
ngx-toastrSame concept and options; the quickest swap.
MatSnackBarWhen you use Angular Material.
Your own service with CDK OverlayWhen notifications are part of your design system.

How to migrate it

  1. Wrap notifications in your own NotificationService so components never call the library directly.
  2. Downgrade that service and switch the legacy code to it.
  3. 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