Comparing version 0.0.3 to 0.0.4
@@ -76,8 +76,48 @@ export interface Component { | ||
* @Component({ | ||
* template: ` | ||
* Bank Name: {{bankName}} | ||
* Account Id: {{id}} | ||
* ` | ||
* template: require("some.html") | ||
* }) | ||
* | ||
* class App { | ||
* @Input test: string; | ||
* } | ||
* ``` | ||
*/ | ||
(bindingPropertyName?: string): any; | ||
new (bindingPropertyName?: string): any; | ||
} | ||
/** | ||
* Type of the Output metadata. | ||
*/ | ||
export interface Output { | ||
/** | ||
* Name used when instantiating a component in the template. | ||
*/ | ||
bindingPropertyName?: string; | ||
} | ||
/** | ||
* Output decorator and metadata. | ||
*/ | ||
export declare const Output: OutputDecorator; | ||
/** | ||
* Type of the Output decorator / constructor function. | ||
*/ | ||
export interface OutputDecorator { | ||
/** | ||
* Declares a data-bound input property. | ||
* | ||
* Angular automatically updates data-bound properties during change detection. | ||
* | ||
* `Output` takes an optional parameter that specifies the name | ||
* used when instantiating a component in the template. When not provided, | ||
* the name of the decorated property is used. | ||
* | ||
* ### Example | ||
* | ||
* The following example creates a component with two input properties. | ||
* | ||
* ```typescript* | ||
* @Component({ | ||
@@ -87,3 +127,5 @@ * template: require("some.html") | ||
* | ||
* class App {} | ||
* class App { | ||
* @Output() onRowClick: Function; | ||
* } | ||
* ``` | ||
@@ -95,1 +137,6 @@ */ | ||
export interface EventEmitter { | ||
emit(event?: any); | ||
subscribe(callback: Function); | ||
} |
{ | ||
"name": "ng1-shift", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Angular 1.5+ decorators for writing Angular2 like.", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "jest --watchAll", | ||
"postinstall": "npm run build", | ||
"build": "tsc index.ts --module umd --outDir dist", | ||
"start": "rollup -c --watch" | ||
}, | ||
@@ -26,3 +29,26 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/readdle/ng1-shift#readme" | ||
"homepage": "https://github.com/readdle/ng1-shift#readme", | ||
"jest": { | ||
"transform": { | ||
".ts": "<rootDir>/node_modules/ts-jest/preprocessor.js" | ||
}, | ||
"testRegex": "(\\.(test|spec))\\.ts$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@types/angular": "1.6.17", | ||
"@types/jest": "19.2.4", | ||
"angular": "1.6.4", | ||
"jest": "20.0.4", | ||
"rollup": "0.41.6", | ||
"rollup-plugin-alias": "1.3.1", | ||
"rollup-plugin-typescript": "0.8.1", | ||
"rollup-watch": "3.2.2", | ||
"ts-jest": "20.0.5", | ||
"tslib": "1.7.1", | ||
"typescript": "2.3.4" | ||
} | ||
} |
@@ -76,2 +76,22 @@ # ng1-shift | ||
## Output | ||
Property decorator for callback bindings. Literary puts binding property name into static object `bindings` as callback binding "&". | ||
```typescript | ||
class CatComponent { | ||
@Output("onAliasCallback") onCallback: Function; | ||
} | ||
``` | ||
Equals to: | ||
```typescript | ||
class CatComponent { | ||
static bindings = { | ||
onCallback: "&onAliasCallback" | ||
}; | ||
onCallback: Function; | ||
} | ||
``` | ||
## Inject | ||
@@ -78,0 +98,0 @@ Parameter decorator for injection. Works a bit differ from **@Inject** in Angular 2. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
18916
16
432
1
117
11
1
1