Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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 -S 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";
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";
@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;
}
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 47 weekly downloads. As such, ng1-shift popularity was classified as not popular.
We found that ng1-shift demonstrated a not healthy version release cadence and project activity because the last version was released 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.