In my model class, I have defined observables and I am looking to subscribe to their sets. Below is the code snippet that showcases what I currently have:
var dto = function (data) {
var self = this;
self.Value1 = ko.observable(data.Value1);
self.Value1.subscribe(function(){
console.log('here');
});
};
The issue I am encountering is that the console.log statement is not triggered when Value1 is initially set using ko.observable(data.Value1).
Can someone guide me on how I can ensure that the subscribe function is called both during the initial setting of the value and also whenever it changes?