Added module declaration to ko.plus so it works with node, amd etc.

This commit is contained in:
Howard Richards
2017-08-30 11:37:20 +01:00
parent eefbfbbe25
commit b72f3df709
2 changed files with 21 additions and 2 deletions

View File

@@ -21,6 +21,9 @@
*
* Version 1.2 - amended callback on commmand.fail() method - accepts response,
* status and message values
*
* Version 1.3 - added module declaration so it be used with node, requirejs etc.
*
*/
//
@@ -156,3 +159,9 @@ declare namespace KoPlus {
//#endregion
}
declare var ko: KnockoutStatic;
declare module "ko.plus" {
export = ko;
}

View File

@@ -64,7 +64,7 @@ function EditableTests() {
// test editable
var isEditing = edit1.isEditing();
// test editableArray functions:
// test editable functions:
edit1.beginEdit();
edit1.endEdit();
edit1.cancelEdit();
@@ -88,7 +88,7 @@ function EditableArrayTests() {
// test properties
var isEditing = edit1.isEditing();
// test functions:
// test editable array functions:
edit1.beginEdit();
edit1.endEdit();
edit1.cancelEdit();
@@ -118,4 +118,14 @@ function SortableTests() {
sort2.sortDescending(true);
sort2.setSourceKey("name");
sort2.sortDescending(false);
}
function BindingHandlerTests() {
// test binding handlers
var bh1 = ko.bindingHandlers.command;
var bh2 = ko.bindingHandlers.loadingWhen;
var bh3 = ko.bindingHandlers.sortBy;
}