angular-progress-http is a specialized library providing upload and download progress tracking for HTTP requests within Angular applications. Its `1.0.0` version, which is the latest, is explicitly designed for Angular 4 and 5 environments, relying on the `@angular/http` module and RxJS 5. The library functions as a thin wrapper around Angular's standard `Http` service, extending its capabilities to expose XMLHttpRequest-level progress events through an Angular-friendly observable pattern. Key differentiators include its fluent, immutable API, where `withUploadProgressListener` and `withDownloadProgressListener` methods return new service instances, ensuring that progress handlers are not accidentally overwritten and providing type-safe chaining. This design allows for separate, distinct listeners for both upload and download events, a crucial feature for applications involving large file transfers or data intensive operations during its active development period. Given the deprecation and subsequent removal of `@angular/http` in newer Angular versions, this package is no longer compatible with modern Angular applications.
npm install angular-progress-httpVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import `ProgressHttpModule` into an Angular module, inject `ProgressHttp` into a component, and utilize its `withUploadProgressListener` and `withDownloadProgressListener` methods to track and display HTTP request progress.
For modern Angular applications (v9+), use the `HttpClient` from `@angular/common/http` which has built-in progress tracking support. Consult the Angular documentation for `HttpClient`.
For Angular 2, install `angular-progress-http@0.5.1`. For Angular 4/5, install `angular-progress-http@1.0.0`.
Always chain different listener types or call a listener only once before executing the HTTP method. For example: `this.http.withUpload().withDownload().post(...)` is correct, but `this.http.withUpload().withUpload().post(...)` is redundant and the first listener will be ignored.
Ensure `ProgressHttpModule` is listed in the `imports` array of your main Angular module (e.g., `AppModule`). Also, ensure `HttpModule` (from `@angular/http`) is imported first, as `ProgressHttpModule` relies on it.
Change your constructor injection from `private http: Http` to `private http: ProgressHttp` in your component or service.
Verify that your `post`, `get`, or other HTTP method call is syntactically correct and that `HttpModule` from `@angular/http` is imported in your root module before `ProgressHttpModule`.