
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
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 25 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
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.