I have a custom binding, that has implemented update.
I would like to know what the value was before update was called. I can not see that it is passed into any of the parameters. Have i missed it?
ko.bindingHandlers.ticker= {
update: function (element, valueAccessor, allBindingsAccessor) {
var toNumber = ko.utils.unwrapObservable(valueAccessor());
var fromNumber = 0; //<---- can i set this to the old value?
var counter = new Ticker(element, fromNumber, toNumber);
counter.start();
}
}
Currently i am counting from 0 to the value (this is simply animated in the UI) but i would like to be able to count from the old value to the new value instead of it resetting to 0 and then counting from there.