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
| Option | When to choose it |
|---|---|
| Angular CDK Dialog | Unstyled, accessible dialog behavior for your own design. |
| MatDialog | When you use Angular Material. |
| NgbModal | When you use ng-bootstrap. |
How to migrate it
- Create one dialog service in Angular that both frameworks can call.
- Turn each dialog template plus controller into a component; resolve values become injected dialog data.
- 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