Knockout.js Extending value binding with interceptor
问题 This seems to be a common approach to sanitizing/validating/formatting data with knockout when binding to an input field, it creates a reusable custom binding that uses a computed observable. It basically extends the default value binding to include an interceptor that will format/sanitize/validate input before written/read. ko.bindingHandlers.amountValue = { init: function (element, valueAccessor, allBindingsAccessor) { var underlyingObservable = valueAccessor(); var interceptor = ko