Carlos Cifuentes
AngularJS library migration · modals and dialogs

Migrating ngDialog / $uibModal / $mdDialog to modern Angular

AngularJS apps open dialogs through services like ngDialog.open, $uibModal.open or $mdDialog.show, passing a template, a controller and resolve values.

What replaces it

OptionWhen to choose it
Angular CDK DialogUnstyled, accessible dialog behavior for your own design.
MatDialogWhen you use Angular Material.
NgbModalWhen you use ng-bootstrap.

How to migrate it

  1. Create one dialog service in Angular that both frameworks can call.
  2. Turn each dialog template plus controller into a component; resolve values become injected dialog data.
  3. Replace result promises with the dialog reference's afterClosed or closed observable.

Watch out. Dialogs are opened from many screens, so migrate them early through a shared, downgraded service. Legacy screens then open the new dialogs without being migrated themselves.

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