
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Library allows you to write with Angular 2 syntax on Angular 1.5+. That will make your migration to Angular 2(or 4) more easier.
npm i ng1-shift
Decorator for class, which links class to component contoller.
It also passes property template
as a static component value.
Lifecycle hooks:
import {Component, Inject, Input} from "ng1-shift/core";
import {UserDeleteErrorEntity} from "../store/entity/user-delete-error";
@Component({
template: `
<h1>Place your template here</h1>
`,
})
export class PlaygroundComponent implements ng.IController {
ngOnInit() {
}
ngOnChanges() {
}
ngOnDestroy() {
}
}
Equals to:
export class PlaygroundComponent implements ng.IController {
static controller = PlaygroundComponent;
static template = `
<h1>Place your template here</h1>
`;
$onInit() {
}
$onChanges() {
}
$onDestroy() {
}
}
Decorator for class, which links class to directive contoller.
It also passes property selector
as a directive selector.
Lifecycle hooks:
import {Directive} from "ng1-shift/core";
@Directive({
selector: `.ngClassDirective`,
})
export class PlaygroundDirective implements ng.IController {
ngOnInit() {
}
ngAfterViewInit() {
}
ngOnChanges() {
}
ngOnDestroy() {
}
}
Equals to:
export directiveInstance() {
return {
controller: PlaygroundDirective,
restrict: "C"
}
}
class PlaygroundDirective implements ng.IController {
$onInit() {
}
$postLink() {
}
$onChanges() {
}
$onDestroy() {
}
}
Property decorator for bindings. Literary puts binding property name into static object bindings
as one-way binding "<".
class DogComponent {
@Input() name: string;
}
Equals to:
class DogComponent {
static bindings = {
name: "<"
};
name: string;
}
In order to setup two-way binding, you should add @Input
for that property and @Output
with 'Change' postfix property.
class DogComponent {
@Input() name: string;
@Output() nameChange = new EventEmitter();
}
Equals to:
class DogComponent {
static bindings = {
name: "=",
nameChange: "&"
};
name: string;
nameChange: Function;
}
Property decorator for callback bindings. Literary puts binding property name into static object bindings
as callback binding "&".
class CatComponent {
@Output("onAliasCallback") onCallback: Function;
}
Equals to:
class CatComponent {
static bindings = {
onCallback: "&onAliasCallback"
};
onCallback: Function;
}
Parameter decorator for injection. Works a bit differ from @Inject in Angular 2. Just pushes specified injection into static property $inject.
class UserComponent {
constructor(
@Inject("userDataService") private userDataService: IUserDataService
) {
}
}
Equals to:
class UserComponent {
static $inject = ["userDataService"];
constructor(private userDataService: IUserDataService) {
}
}
FAQs
Angular 1.5+ decorators for writing Angular2 like.
The npm package ng1-shift receives a total of 6 weekly downloads. As such, ng1-shift popularity was classified as not popular.
We found that ng1-shift demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.