diff --git a/ko-cart/index.html b/ko-cart/index.html index af8a7c9..f632830 100644 --- a/ko-cart/index.html +++ b/ko-cart/index.html @@ -19,6 +19,7 @@
+ diff --git a/ko-cart/js/custom/koBindings.js b/ko-cart/js/custom/koBindings.js index 55a29fd..8ab5b21 100644 --- a/ko-cart/js/custom/koBindings.js +++ b/ko-cart/js/custom/koBindings.js @@ -23,3 +23,11 @@ ko.bindingHandlers.currency = { }); }, }; + +ko.bindingHandlers.toJSON = { + update: function (element, valueAccessor) { + return ko.bindingHandlers.text.update(element, function () { + return ko.toJSON(valueAccessor(), null, 2); + }); + }, +};