Home / Insights / Architecture and Modernization

Architecture and Modernization

Migrating AngularJS and Old Angular Apps to Modern Angular: A Staged Approach

AngularJS has been out of support since January 2022, and many Angular 2+ apps have drifted several major versions behind. Both problems can be fixed without a big-bang rewrite if the work is staged, measured and tested at every step.

TopicsArchitecture and ModernizationWeb and SaaS Development

Key takeaways

  • AngularJS (1.x) and Angular (2+) are different frameworks, so an AngularJS migration is a re-platforming project, while an old Angular app usually needs a sequence of version upgrades plus modernisation.
  • For AngularJS, the choice is between an incremental hybrid using ngUpgrade, a route-by-route strangler approach, or a rewrite. Size, test coverage and how much the business logic still matters decide which.
  • For outdated Angular 2+ apps, upgrade one major version at a time with the official tooling, keep the build green after each hop, and only then adopt standalone components, the new control flow and signals.
  • A characterisation test suite on critical journeys, written before any migration work, is what makes staged migration safe.
  • Plan for a period of running two frameworks or two versions side by side, and budget for the performance, tooling and team-skill costs that period brings.

Front-end frameworks age faster than the business processes they support. We regularly meet organisations whose most important internal or customer-facing application is still written in AngularJS, or in an Angular 2+ version that stopped receiving updates years ago. The application works, the users know it, and nobody wants to touch it. Meanwhile, security patches stop, libraries stop supporting it, and hiring developers who want to work on it gets harder.

This article is for CTOs, engineering managers and product owners deciding how to modernise such an application. It explains the two distinct problems (AngularJS versus old Angular), how to assess the codebase, the main migration strategies with their trade-offs, how to sequence the work, and how to manage risk and cost while the business keeps running. It reflects the way we approach Angular work on long-lived products such as the care management platform we build for Australian disability and aged care providers.

Two different problems: AngularJS versus old Angular

The names cause confusion, so it is worth being precise. AngularJS refers to all 1.x versions of the framework. Angular, from version 2 onwards, is a complete rewrite with a different architecture: TypeScript, components rather than controllers and scopes, a different dependency injection system and a different change detection model. Moving from one to the other is closer to re-platforming than upgrading.

The AngularJS documentation states that support officially ended in January 2022. That means no security fixes from the framework team, and a growing number of third-party libraries that no longer support it.

An app built on Angular 2+ but left several majors behind has a different problem. The framework is the same family, and the Angular release policy sets out how each major version receives active support and then long-term support limited to critical and security fixes before it falls out of support entirely. At the time of writing, Angular 20, released on 28 May 2025, is the current major. An app on, say, Angular 12 is out of support, but it can be brought forward with a structured sequence of upgrades.

AngularJS (1.x) appOutdated Angular (2+) app
Nature of workRe-platforming to a different frameworkSequential version upgrades plus modernisation
Typical approachesHybrid with ngUpgrade, strangler by route, rewriteOne-major-at-a-time upgrade, then adopt newer APIs
Main risksBehaviour changes in business logic, long dual-framework periodBreaking changes in dependencies, abandoned third-party libraries
Tooling helpngUpgrade, manual conversion, AI-assisted code analysisng update, official update guide, automated migrations

Assessing the codebase before choosing a route

Do not choose a strategy until you understand what you have. A two-week assessment usually pays for itself by preventing a wrong turn. Cover the following:

  • Size and shape: number of modules, components or directives, services, routes and lines of code. Identify which areas change often and which are stable.
  • Code quality relative to the target: for AngularJS, whether the code already uses the component API introduced in 1.5, one item per file and feature folders, or whether it relies on controllers, scope inheritance and complex directives.
  • Dependencies: every third-party library, its maintenance status and whether a modern equivalent exists. Abandoned UI component libraries are often the hardest part of an upgrade.
  • Tests: what unit and end-to-end coverage exists, and whether it still runs. Tests on old runners that nobody has executed in a year should be treated as absent.
  • Build and deployment: module loader, bundler, Node version and CI pipeline. A Grunt or Gulp build with script tags is a separate migration in itself.
  • Business knowledge: who understands the rules encoded in the front end. Logic in controllers is often undocumented.

Where documentation is thin, AI-assisted code analysis can speed up the inventory of screens, rules and dependencies, as described in our article on reverse-engineering legacy applications. Record the resulting decision, with its reasoning, in an architecture decision record so the rationale survives team changes.

AngularJS: hybrid, strangler or rewrite?

There are three realistic routes from AngularJS to Angular. Each can work; the right one depends on the assessment.

Option 1: incremental hybrid with ngUpgrade

The official Upgrading from AngularJS guide describes running both frameworks in one application using UpgradeModule. Both frameworks run fully, with each DOM element owned by one of them. Angular components can be downgraded for use in AngularJS templates with downgradeComponent(), AngularJS component directives can be wrapped for use in Angular, and services can cross in both directions, for example with downgradeInjectable(). Change detection is bridged, so developers rarely need manual $apply() calls. The guide also shows how to lazy-load the AngularJS part so it only runs on routes that still need it.

This route lets you ship continuously while migrating, but it has a cost: two frameworks in the bundle, two mental models for developers, and interoperability bugs at the boundaries.

Option 2: strangler by route or micro-front-end

Build new Angular screens as a separate application and route users to them one area at a time, with a shared shell or reverse proxy deciding which application serves each URL. The two codebases stay cleanly separate. This works best when the app divides naturally into areas with few shared widgets. It is the front-end version of the pattern described in our strangler fig article.

Option 3: rewrite

A rewrite is justified when the existing code is small, poorly structured, untested and its business rules are well understood elsewhere, or when the product is being redesigned anyway. It is the riskiest option for large, logic-heavy applications because behaviour that nobody documented gets lost.

FactorHybrid (ngUpgrade)Strangler by routeRewrite
Best forLarge apps with shared widgets, well-structured 1.5+ component codeApps with clear functional areasSmall or poorly structured apps, or a planned redesign
Continuous delivery during migrationYesYesLimited; features often frozen
Runtime overheadBoth frameworks loaded (mitigated by lazy loading)Separate apps; possible duplicated assetsNone after cut-over
Main riskBoundary bugs, long tail of unmigrated piecesInconsistent UX across areas, shared stateLost behaviour, schedule overrun

For example, a logistics company with a 200-screen AngularJS operations portal and decent component structure might choose the hybrid route, converting shared services first and then screens in order of change frequency. The figures are illustrative; the logic is to migrate what changes most, first.

Preparing an AngularJS codebase for migration

The official guide makes a point that is often skipped: the better aligned your AngularJS code is with Angular concepts before you start, the easier everything after it becomes. Preparation can begin immediately and delivers value even if migration is delayed.

  1. Restructure files. One component, service or filter per file, organised by feature, so each piece can move independently.
  2. Introduce a module bundler. Replace script tags with a modern bundler and explicit imports.
  3. Adopt TypeScript. Rename files to .ts, add types gradually, and convert services and controllers to classes.
  4. Convert directives to components. Use the AngularJS component API and lifecycle hooks such as $onInit(), and remove features with no Angular equivalent, such as replace: true, compile, priority and terminal.
  5. Remove scope soup. Replace scope inheritance and watchers with explicit inputs, outputs and services.
  6. Write characterisation tests. Capture the current behaviour of critical journeys in end-to-end tests that do not care which framework renders the page.

Steps 1 to 4 are mechanical and can be done in parallel with feature work. Step 6 is the safety net for everything that follows.

Upgrading an outdated Angular 2+ application

If your application is already on Angular 2+, the path is more predictable, but it still needs discipline.

Hop one major version at a time

The Angular CLI’s ng update command and the official update guide are designed for moving one major version at a time. Skipping versions multiplies breaking changes and makes failures hard to diagnose. For each hop:

  1. Update Node.js and TypeScript to versions supported by the target release.
  2. Run ng update for the core and CLI packages and let its migrations run.
  3. Update Angular Material, NgRx and other ecosystem libraries to compatible versions.
  4. Fix compilation errors and deprecations, run the full test suite, and deploy to a test environment.
  5. Commit and tag before starting the next hop.

Deal with third-party libraries early

The blocker is rarely Angular itself; it is a date picker, charting or grid library that stopped at an old version. Identify replacements during the assessment and swap them before the version hop that breaks them.

Modernise once you are current

Reaching the latest version is not the same as having a modern codebase. Angular provides automated migrations that convert NgModule-based components to standalone components, replace *ngIf and *ngFor with the built-in control flow syntax, move constructor injection to the inject() function, convert eagerly loaded routes to lazy-loaded ones, and switch decorator-based inputs, outputs and queries to their signal-based equivalents. Run these as separate, reviewable changes rather than in one sweep, and measure bundle size and performance before and after.

Running the migration as a programme

Whatever the route, a migration that runs alongside feature work needs explicit rules.

  • Define done per unit. A screen or module is migrated when it runs on the target framework, its tests pass, the old code is deleted and no AngularJS or legacy dependency remains in it.
  • Track progress visibly. A simple count of migrated versus remaining components and routes, reviewed every sprint, keeps the long tail from stalling.
  • Freeze new legacy code. From day one, all new features are built in the target framework.
  • Allocate fixed capacity. Reserve a set share of each sprint for migration so it neither stalls nor crowds out the roadmap. Agree the share with the product owner; there is no universal right number.
  • Plan the decommission. Schedule removal of ngUpgrade, AngularJS and old build tooling as an explicit milestone with a date.

Skills and team

A hybrid period needs developers who understand both frameworks, which is a narrower skill set than either alone. If your team lacks that experience, bringing in engineers who have done it before for the first phase, then handing over, is usually cheaper than learning on the critical path. Our Angular developers work in your repositories and review process and cover upgrades from AngularJS and older Angular releases as well as new development.

Risks, costs and a migration checklist

Where the cost goes

  • Assessment and preparation: relatively small, and useful even if migration is delayed.
  • Dual running: extra bundle size, build complexity and developer cognitive load for as long as two frameworks or versions coexist. Keep this period as short as practical.
  • Library replacement: often the largest unplanned cost, especially for complex grids and editors.
  • Testing: characterisation tests up front and regression testing at every step.

Risks to manage

  • Silent behaviour change. Validation rules, rounding and date handling encoded in old controllers can change subtly during conversion. Characterisation tests are the defence.
  • The long tail. The final screens to migrate are often rarely used and poorly understood. Decide early whether to migrate, retire or replace them.
  • Performance regressions in hybrid mode. Measure page load and interaction performance on real devices throughout, and lazy-load the legacy framework where possible.
  • Scope creep. Migration invites redesign. Separate the two unless the business explicitly funds the redesign.

Checklist

  • Codebase assessment completed, with dependency inventory and test status.
  • Strategy chosen and recorded in an architecture decision record.
  • Characterisation end-to-end tests cover all critical journeys and run in CI.
  • For AngularJS: files restructured, bundler and TypeScript in place, directives converted to components.
  • For Angular 2+: upgrade plan listing each major hop and the library changes it requires.
  • Definition of done per migrated unit agreed; progress tracked each sprint.
  • Rule in place that all new features use the target framework.
  • Decommission milestone for legacy framework and tooling scheduled.

Frequently asked questions

Is AngularJS still safe to run in production?

It runs, but the framework has had no official support since January 2022, so new vulnerabilities will not be fixed by the framework team and library support is shrinking. Risk depends on exposure; a public, data-handling application carries more risk than an internal tool behind strong access controls.

Can we go straight from AngularJS to the latest Angular?

Yes. AngularJS migrates to whichever Angular version you target, so start with the current major. The version-by-version hops only apply to apps already on Angular 2+.

How long does an AngularJS migration take?

It depends on size, code quality, test coverage and how much capacity you allocate. A short assessment of the codebase gives a far better estimate than any rule of thumb; be wary of quotes made without one.

Should we move to React instead of modern Angular?

Only if there is a strong reason beyond the migration itself, such as consolidating on a single front-end stack. AngularJS to Angular has official interoperability tooling; moving to a different framework is effectively a rewrite with no such bridge.

Do we need to adopt signals and standalone components immediately?

No. Get to a supported version first. Angular provides automated migrations for standalone components, control flow and signal-based inputs, which can then be applied gradually as separate, reviewable changes.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. AngularJS: Version Support Status — accessed 9 November 2026. Statement that AngularJS support officially ended in January 2022.
  2. Angular: Versioning and releases — accessed 9 November 2026. Release and support policy (active then long-term support) and the 28 May 2025 release date of Angular 20.
  3. Angular documentation: Upgrading from AngularJS (official guide source) — accessed 9 November 2026. Preparation steps, ngUpgrade hybrid applications, downgrading and upgrading components and services, and lazy-loading AngularJS.
  4. Angular: Migrations — accessed 9 November 2026. Automated migrations for standalone components, control flow, inject(), lazy-loaded routes and signal-based inputs, outputs and queries.

Is your AngularJS or older Angular app holding back your roadmap?

We can assess your codebase, recommend a hybrid, strangler or rewrite route with reasons, and provide Angular engineers to carry out the migration with your team.