Migrating angular-loading-bar to modern Angular
angular-loading-bar added an $http interceptor that showed a thin progress bar at the top of the page while requests were pending. It is tied to AngularJS.
What replaces it
| Option | When to choose it |
|---|---|
| HTTP interceptor + your own bar | A counter of pending requests in a signal, shown with a CSS bar or MatProgressBar. |
| @ngx-loading-bar (core, http-client, router) | Same idea ready-made: an automatic bar for HttpClient requests and route changes. |
How to migrate it
- Check which requests were excluded with ignoreLoadingBar and what latency threshold was configured.
- Add a functional interceptor that counts pending HttpClient requests, or install the replacement package.
- During the hybrid phase, feed the same counter from a legacy $http interceptor so users see a single bar.
Watch out. Background polling and autocomplete requests should not trigger the bar. Use an HttpContext token to mark the requests that skip it.
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