EDITED: The first answer was wrong!
In chrome, the console is asynchronous, and console.log () does not happen where it was expected.
Using setTimeout works great. See this fiddle script
var ViewModel = function() { var self = this; self.isLoading = ko.observable(false); self.someOperation = function() { self.isLoading(true); window.setTimeout(function() { self.isLoading(false) }, 1000);
source share