<img src="http://www.aero-sa.com/images/ajax-loader.gif" data-bind="visible:loading" />
var model = function() {
var self = this;
this.loading = ko.observable(true);
setTimeout(function() {
self.loading(false);
}, 4000);
}
ko.applyBindings(new model());
i have few question on the above code. what is this
keyword here? this denote what? when i write the code like then image is not getting hide....why this keyword is not working setTimeout.
var model = function() {
//var self = this;
this.loading = ko.observable(true);
setTimeout(function() {
this.loading(false);
}, 4000);
}
ko.applyBindings(new model());
please explain if possible.