ko.plus - amended signature of .fail method of command

Fail callback can be more than just a text response, added new callback
signature to address this.
This commit is contained in:
Howard Richards
2015-10-19 11:41:56 +01:00
parent 4e8533a032
commit 04a57f081b
2 changed files with 16 additions and 4 deletions
+10 -2
View File
@@ -11,6 +11,9 @@
Version 1.1 - added test for makeEditable
Version 1.2 - amended callback on commmand.fail() method - accepts response,
status and message values
Note: Typescript version 1.4 or higher is required for union types
and type declarations
*/
@@ -29,8 +32,13 @@ function CommandTests() {
.done((data: any) => {
alert("success");
})
.fail((error: string) => {
alert(error);
.fail((response) => {
// dummy
return false;
})
.fail((response, status, message) => {
// fail has response, error and text
alert(status + message);
});
// initialize command with options (action only)