Merge pull request #19454 from conficient/master

Added module declaration to ko.plus so it works with node, amd etc.
This commit is contained in:
Nathan Shively-Sanders
2017-09-07 10:20:26 -07:00
committed by GitHub
2 changed files with 23 additions and 3 deletions
+10 -1
View File
@@ -4,7 +4,6 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery" />
/// <reference types="knockout" />
/**
@@ -21,6 +20,10 @@
*
* 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.
* removed jquery reference as it is not required
*
*/
//
@@ -156,3 +159,9 @@ declare namespace KoPlus {
//#endregion
}
declare var ko: KnockoutStatic;
declare module "ko.plus" {
export = ko;
}
+13 -2
View File
@@ -1,3 +1,4 @@
function CommandTests() {
// initalize command with an execute method
var cmd1 = ko.command(() => {
@@ -64,7 +65,7 @@ function EditableTests() {
// test editable
var isEditing = edit1.isEditing();
// test editableArray functions:
// test editable functions:
edit1.beginEdit();
edit1.endEdit();
edit1.cancelEdit();
@@ -88,7 +89,7 @@ function EditableArrayTests() {
// test properties
var isEditing = edit1.isEditing();
// test functions:
// test editable array functions:
edit1.beginEdit();
edit1.endEdit();
edit1.cancelEdit();
@@ -118,4 +119,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;
}