Added aurelia-knockout 2.0.0 (#14880)

* added aurelia-knockout 2.0.0

* fixed tslint errors in aurelia-knockout
This commit is contained in:
Christian Kotzbauer 2017-03-10 08:39:31 +01:00 committed by Mohamed Hegazy
parent 8d1cf56e25
commit ea79711677
4 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,11 @@
export class ViewModel {
constructor(private knockoutBindable: KnockoutBindable) {
}
activate(settings: any): void {
this.knockoutBindable.applyBindableValues(settings, this);
this.knockoutBindable.applyBindableValues(settings, this, true);
}
}

19
aurelia-knockout/index.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
// Type definitions for aurelia-knockout 2.0
// Project: https://github.com/code-chris/aurelia-knockout
// Definitions by: Christian Kotzbauer <https://github.com/code-chris>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare interface KnockoutBindable {
/**
* Applys all values from a data object (usually the activation data) to the corresponding instance fields
* in the current view model if they are marked as @bindable. By default all matching values from the data object
* are applied. To only apply observable values set the last parameter to `true`. Subscriptions are created
* for all Knockout observables in the data object to update the view-model values respectively.
*
* @param data - the data object
* @param target - the target view model
* @param applyOnlyObservables - `true` if only observable values should be applied, false by default.
*/
applyBindableValues(data: any, target: any, applyOnlyObservables?: boolean): void;
}

View File

@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"aurelia-knockout-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "../tslint.json" }