Roadmap › AngularJS (1.x) — Legacy › Module: Scope, Digest and Directives
Lessons in this course (13)
13. Performance and migration to Angular
Advanced★ Must knowLesson 13 of 13
Performance: reduce watchers (one-time binding ::, avoid deep watches), track by in ng-repeat, ng-if over ng-show for heavy hidden sections, avoid filters in large repeats, paginate/virtualise lists, $applyAsync/$httpProvider.useApplyAsync(true), disable debug info in production ($compileProvider.debugInfoEnabled(false)), $scope.$digest() locally instead of global $apply in hot paths.
Migration paths:
- Prepare: upgrade to 1.8, use components + controller-as + one-way bindings, TypeScript and a bundler, remove
$scopesoup. - Hybrid app with ngUpgrade (
UpgradeModule): bootstrap both frameworks; downgrade new Angular components/services to use in AngularJS, upgrade AngularJS services to inject in Angular; migrate feature by feature, route by route. - Or rewrite incrementally behind a reverse proxy / micro-frontends (different routes served by different apps).
- Remove AngularJS when the last feature moves.
Because AngularJS is EOL, also consider migrating to React or Vue; the strategy (strangler pattern by route/feature) is the same.