{"id":15648831,"url":"https://github.com/darkxahtep/angular-progress-http","last_synced_at":"2025-10-09T12:13:22.276Z","repository":{"id":57178943,"uuid":"77350575","full_name":"DarkXaHTeP/angular-progress-http","owner":"DarkXaHTeP","description":"[DEPRECATED] Use @angular/common/http instead","archived":false,"fork":false,"pushed_at":"2017-12-10T15:49:27.000Z","size":340,"stargazers_count":41,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-19T11:08:53.313Z","etag":null,"topics":["ajax","angular","angular2","http","ng2","progress","typescript","upload","upload-listener","xhr","xmlhttprequest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DarkXaHTeP.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-26T01:43:16.000Z","updated_at":"2024-03-25T08:49:28.000Z","dependencies_parsed_at":"2022-09-09T19:00:47.476Z","dependency_job_id":null,"html_url":"https://github.com/DarkXaHTeP/angular-progress-http","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/DarkXaHTeP/angular-progress-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fangular-progress-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fangular-progress-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fangular-progress-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fangular-progress-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarkXaHTeP","download_url":"https://codeload.github.com/DarkXaHTeP/angular-progress-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarkXaHTeP%2Fangular-progress-http/sbom","scorecard":{"id":37419,"data":{"date":"2025-08-11","repo":{"name":"github.com/DarkXaHTeP/angular-progress-http","commit":"50eb8e951a6892010657ea6fcd4d5aa3bb11b883"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"175 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-c75v-2vq8-878f","Warn: Project is vulnerable to: GHSA-3v6h-hqm4-2rg6","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-wxhq-pm8v-cw75","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-p28h-cc7q-c4fg","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-hr2v-3952-633q","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p","Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q","Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-j4f2-536g-r55m","Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-9prh-257w-9277","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-pfq8-rq6v-vf5m","Warn: Project is vulnerable to: GHSA-6x33-pw7p-hmpq","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-8g7p-74h8-hg48","Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-7x7c-qm48-pq9c","Warn: Project is vulnerable to: GHSA-rc3x-jf5g-xvc5","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-5947-m4fg-xhqg","Warn: Project is vulnerable to: GHSA-779f-wgxg-qr8f","Warn: Project is vulnerable to: GHSA-82v2-mx6x-wq7q","Warn: Project is vulnerable to: GHSA-pp57-mqmh-44h7","Warn: Project is vulnerable to: GHSA-4xcv-9jjx-gfj3","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f","Warn: Project is vulnerable to: GHSA-44fp-w29j-9vj5","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-9v62-24cr-58cx","Warn: Project is vulnerable to: GHSA-r8f7-9pfq-mjmv","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-q75g-2496-mxpp","Warn: Project is vulnerable to: GHSA-6fx8-h7jm-663j","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-hxcm-v35h-mg2x","Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-7mwh-4pqv-wmr8","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-fxwf-4rqh-v8g3","Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj","Warn: Project is vulnerable to: GHSA-xfhh-g9f5-x4m4","Warn: Project is vulnerable to: GHSA-qm95-pgcg-qqfq","Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9","Warn: Project is vulnerable to: GHSA-c9g6-9335-x697","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-325j-24f4-qv5x","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-g7q5-pjjr-gqvp","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-884p-74jh-xrg2","Warn: Project is vulnerable to: GHSA-j7fq-p9q7-5wfv","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-34r7-q49f-h37c","Warn: Project is vulnerable to: GHSA-c9f4-xj24-8jqx","Warn: Project is vulnerable to: GHSA-pv4c-p2j5-38j4","Warn: Project is vulnerable to: GHSA-46c4-8wrp-j99v","Warn: Project is vulnerable to: GHSA-9m6j-fcg5-2442","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-mgfv-m47x-4wqp","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-cf66-xwfp-gvc4","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-4fc4-chg7-h8gh","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-5v72-xg48-5rpm","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv","Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q","Warn: Project is vulnerable to: GHSA-crh6-fp67-6883","Warn: Project is vulnerable to: GHSA-72mh-269x-7mh5","Warn: Project is vulnerable to: GHSA-h4j5-c7cj-74xg","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp","Warn: Project is vulnerable to: GHSA-qm28-7hqv-wg5j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T20:38:34.061Z","repository_id":57178943,"created_at":"2025-08-14T20:38:34.061Z","updated_at":"2025-08-14T20:38:34.061Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001441,"owners_count":26083078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","angular","angular2","http","ng2","progress","typescript","upload","upload-listener","xhr","xmlhttprequest"],"created_at":"2024-10-03T12:26:36.061Z","updated_at":"2025-10-09T12:13:22.245Z","avatar_url":"https://github.com/DarkXaHTeP.png","language":"TypeScript","readme":"# angular-progress-http\n\nA thin wrapper around Angular 2+ Http service that adds ability to work with upload/download progress\n\n### npm\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][npm-url]\n\n### build info\n[![Build Status](https://travis-ci.org/DarkXaHTeP/angular-progress-http.svg?branch=master)](https://travis-ci.org/DarkXaHTeP/angular-progress-http)\n[![Coverage Status](https://coveralls.io/repos/DarkXaHTeP/angular-progress-http/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/DarkXaHTeP/angular-progress-http?branch=master)\n\n## Usage\nImport HttpModule and ProgressHttpModule\n``` ts\nimport { NgModule } from \"@angular/core\";\nimport { HttpModule } from \"@angular/http\";\nimport { ProgressHttpModule } from \"angular-progress-http\";\n\n@NgModule({\n    imports: [\n        HttpModule,\n        ProgressHttpModule\n    ]\n})\nexport class AppModule {}\n```\nInject ProgressHttp into your component and you are ready to go.\nSee [API description below](#api-description) for available methods.\n``` ts\nimport {Component} from \"@angular/core\";\nimport { ProgressHttp } from \"angular-progress-http\";\n\n@Component({})\nexport class AppComponent {\n    constructor(private http: ProgressHttp) {\n        const form = new FormData();\n        form.append(\"data\", \"someValue or file\");\n\n        this.http\n            .withUploadProgressListener(progress =\u003e { console.log(`Uploading ${progress.percentage}%`); })\n            .withDownloadProgressListener(progress =\u003e { console.log(`Downloading ${progress.percentage}%`); })\n            .post(\"/fileUpload\", form)\n            .subscribe((response) =\u003e {\n                console.log(response)\n            })\n    }\n}\n```\n\n## Supported Angular versions\n* Both Angular 4 and 5 are supported by the latest version\n* Angular 2 is supported in v0.5.1. Use command `npm install angular-progress-http@0.5.1` to get it\n\n## Releases\nFor release notes please see [CHANGELOG.md](https://github.com/DarkXaHTeP/angular-progress-http/blob/master/CHANGELOG.md)\n\n## API description\n\nProgressHttp service extends Http service provided by Angular/Http which means that you get all of the Http methods including\n``` ts\nrequest(url: string | Request, options?: RequestOptionsArgs): Observable\u003cResponse\u003e;\nget(url: string, options?: RequestOptionsArgs): Observable\u003cResponse\u003e;\npost(url: string, body: any, options?: RequestOptionsArgs): Observable\u003cResponse\u003e;\n```\nand others.\n\nIn addition it provides two methods for handling progress:\n``` ts\nwithDownloadProgressListener(listener: (progress: Progress) =\u003e void): HttpWithDownloadProgressListener;\nwithUploadProgressListener(listener: (progress: Progress) =\u003e void): HttpWithUploadProgressListener;\n```\nThey both take callback as argument and return new instances of the service.\n\nThe interfaces returned from methods are described below:\n``` ts\ninterface HttpWithDownloadProgressListener extends Http {\n    withUploadProgressListener(listener: (progress: Progress) =\u003e void): Http;\n}\n\ninterface HttpWithUploadProgressListener extends Http {\n    withDownloadProgressListener(listener: (progress: Progress) =\u003e void): Http;\n}\n```\nTheir purpose is to make libary easier to use and add compile-time checks for method calls\n``` ts\nprogressHttp //can use http api or call withUploadProgressListener or withDownloadProgressListener\n    .withUploadProgressListener(progress =\u003e {}) //can use http api or call withDownloadProgressListener\n    .withDownloadProgressListener(progress =\u003e {}) //here and on lines below can only use http api\n    .post(\"/fileUpload\", form)\n    .subscribe((response) =\u003e {})\n```\nThis restriction is used to make sure that there are now repeating calls to add progress listeners that will overwrite previously assigned handlers and may confuse developer\n\nCalls to both methods are immutable (return new instances and do not change the internal state of the service), so you may do next things\n``` ts\nlet http1 = this.progressHttp.withUploadProgressListener(progress =\u003e { console.log(\"Uploading 1\") });\nlet http2 = this.progressHttp.withUploadProgressListener(progress =\u003e { console.log(\"Uploading 2\") });\nlet http3 = http1.withDownloadProgressListener(progress =\u003e { console.log(\"Downloading 1\") });\n```\nIn the code above http1 and http2 will have different upload listeners. http3 will have same upload listener as http1 and a download listener\n\nThis behavior may be useful when uploading multiple files simultaneously e.g.\n``` ts\nthis.files.forEach(f =\u003e {\n    const form = new FormData();\n    form.append(\"file\", f.file);\n\n    this.progressHttp\n        .withUploadProgressListener(progress =\u003e { f.percentage = progress.percentage; })\n        .post(\"/fileUpload\", form)\n        .subscribe((r) =\u003e {\n            f.uploaded = true;\n        })\n});\n```\n\n## Progress interface\nBoth upload and download progress listeners accept single argument that implements Progress interface\n``` ts\ninterface Progress {\n    event: ProgressEvent, //event emitted by XHR\n    lengthComputable: boolean, //if false percentage and total are undefined\n    percentage?: number, //percentage of work finished\n    loaded: number, //amount of data loaded in bytes\n    total?: number // amount of data total in bytes\n}\n```\n\n## How it works internally\nThe library tries to rely on Angular code as much as possible instead of reinventing the wheel.\n\nIt extends BrowserXhr class with logic that adds event listeners to XMLHttpRequest and executes progress listeners.\nOther parts that are responsible for http calls (Http, XhrConnection, XhrBackend) are used as is,\nwhich means that angular-progress-http will automatically receive fixes and new features from newer versions of angular/http\n\n## Using custom HTTP implementations\nIf you want to use custom Http service with progress you need to follow certain steps.\nLet's review them on example of [ng2-adal library](https://www.npmjs.com/package/ng2-adal) - a library for accessing APIs restricted by Azure AD.\n1. create factory class that will implement HttpFactory interface\n```ts\ninterface HttpFactory {\n    create\u003cT extends Http\u003e(backend: ConnectionBackend, requestOptions: RequestOptions): T;\n}\n```\nThis interface contains single method to create instances of class derived from Http.\nThe create method accepts ConnectionBackend and default RequestOptions which are always required for Http to make creation of factory easier.\n\nLet's examine AuthHttp (Http implementation from ng2-adal) constructor to understand what dependencies it has:\n```ts\nconstructor(http: Http, adalService: AdalService);\n```\nAs you can see, it needs an instance of http service and adalService to work properly.\nWith this knowledge we can now create the factory class.\n\nThe factory for ng2-adal is quite simple and will look next way:\n```ts\nimport { Injectable } from \"@angular/core\";\nimport { ConnectionBackend, RequestOptions } from \"@angular/http\";\nimport { AuthHttp, AdalService } from \"ng2-adal/core\";\nimport { HttpFactory, AngularHttpFactory } from \"angular-progress-http\";\n\n@Injectable()\nexport class AuthHttpFactory implements HttpFactory {\n  constructor(\n    private adalService: AdalService,\n    private angularHttpFactory: AngularHttpFactory\n  ) {}\n\n  public create(backend: ConnectionBackend, requestOptions: RequestOptions) {\n    const http = this.angularHttpFactory.create(backend, requestOptions);\n    return new AuthHttp(http, this.adalService);\n  }\n}\n\n```\n\n2. Register created factory as a provider in your application\n```ts\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\nimport { HttpModule } from '@angular/http';\nimport { ProgressHttpModule, HTTP_FACTORY } from 'angular-progress-http';\nimport { AuthHttpModule } from \"ng2-adal/core\";\nimport { AuthHttpFactory } from \"./ng2-adal.http.factory.service\";\n\nimport { AppComponent } from './app.component';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    HttpModule,\n    ProgressHttpModule,\n    AuthHttpModule\n  ],\n  providers: [\n    { provide: HTTP_FACTORY, useClass: AuthHttpFactory }\n  ],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n```\nThat's it.\nNow each time when you will call methods of ProgressHttp it will use your custom http implementation internally and add progress listeners to it.\n\n\n## Building from sources\n1. Clone the repository to the local PC\n2. Run\n``` bash\nnpm install\nnpm run build\n```\n3. The built library can be found in \"build\" folder\n\n## Running tests\n1. Clone the repository to the local PC\n2. Run\n``` bash\nnpm install\nnpm test\n```\n\n## Running examples\nThere are two example projects at the moment\n- basic example of upload progress functionality (examples/upload-download)\n- an example that uses custom http implementation (examples/custom-http)\n\n1. Make sure that you built library from sources as described [above](#building-from-sources)\n2. Navigate to selected example folder\n2. Run\n``` bash\nnpm install\nnpm start\n```\n4. Open browser on http://localhost:3000\n5. Choose some files (big size of the files will let you see the progress bar) and click upload\n6. Use throttling in Chrome dev tools to slow down network if progress jumps from 0 to 100 immediately\n\n## Сontribution\nFeel free to ask questions and post bugs/ideas in the issues, as well as send pull requests.\n\n[![License](https://img.shields.io/github/license/darkxahtep/angular-progress-http.svg)](https://github.com/DarkXaHTeP/angular-progress-http/blob/master/LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/angular-progress-http.svg\n[npm-url]: https://npmjs.org/package/angular-progress-http\n[downloads-image]: https://img.shields.io/npm/dt/angular-progress-http.svg","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkxahtep%2Fangular-progress-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarkxahtep%2Fangular-progress-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarkxahtep%2Fangular-progress-http/lists"}