Below is a small poc i was working on depicting various functionalities of knockout. I want to call the subscribe method for observableArray, but it returns undefined, i tried two different ways, i am unable to understand what is incorrect. any guidance welcome. I was referring to this article. here Array change subscriptions You can also find the both my jsfiddles below.
self.cartList = ko.observableArray();
self.cartList.subcribe(
function (newValue) {
console.log(ko.toJS(self.cartList));
}, null, "arrayChange");
Simple typo -- you spelled subscribe
wrong.
self.cartList.subscribe(