i just wonder is there any difference between self and this keyword usage or both same
var ViewModel = function(first, last) { this.first = ko.observable(first); this.last = ko.observable(last); this.full = ko.computed(function() { return this.first() + " " + this.last(); }, this); };
var ViewModel = function(first, last) { var self=this; self.first = ko.observable(first); self.last = ko.observable(last); self.full = ko.computed(function() { return self.first() + " " + self.last(); }, self); };
which approach is good and why accepted ? thanks
--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.