
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
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 1 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.