![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
angular-http-harness
Advanced tools
Angular library for seamless migration from `$http` to `Http`.
Angular library for seamless migration from $http
to Http
.
$ npm install --save angular-http-harness
This library provides only one API: HttpHarness
.
HttpHarness
is a wrapped HTTP service with a common interface.
HttpHarness
allows you to separate a DI process and HTTP process.
If you use Promise
in your HTTP services, you must rewrite it to use Observable
.
rxjs@5.0.0
then
and catch
to subscribe
.// from
testService.get("test").then(
resp => {
...
})
.catch(error => {
...
});
// to
testService.get("test").subscribe(
resp => {
...
},
error => {
...
});
TestService
as an abstract classImplement a service except for DI.
Use HttpHarness
instead of $http
or Http
.
import {HttpHarness} from "angular-http-harness";
export abstract class TestService {
private http: HttpHarness;
constructor(http: HttpHarness) {
this.http = http;
}
get(id: string): Observable<any> {
return this.http.get(`/${id}`);
}
}
Ng1TestService
as an entry point for $http
Use fromNg1
.
import {HttpHarness} from "angular-http-harness";
import {fromNg1} from "angular-http-harness/ng1";
export class Ng1TestService extends TestService {
constructor($http: angular.IHttpService) {
super(new HttpHarness(fromNg1($http)));
}
get(id: string): Observable<TestModel> {
return super.get(id).map(resp => resp.data);
}
}
angular.module("app").service("testService", ["$http", Ng1TestService]);
Ng2TestService
as an entry point for Http
Use fromNg2
import {HttpHarness} from "angular-http-harness";
import {fromNg2} from "angular-http-harness/ng2";
@Injectable()
export class Ng2TestService extends TestService {
constructor(_http: Http) {
super(new HttpHarness(fromNg2(_http)));
}
get(id: string): Observable<TestModel> {
return super.get(id).map(resp => resp.json());
}
}
MIT
FAQs
Angular library for seamless migration from `$http` to `Http`.
The npm package angular-http-harness receives a total of 0 weekly downloads. As such, angular-http-harness popularity was classified as not popular.
We found that angular-http-harness demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.