Array change subscriptions returning undefined

45 views Asked by At

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");

fiddle 1

fiddle 2

1

There are 1 answers

1
Antiga On BEST ANSWER

Simple typo -- you spelled subscribe wrong.

self.cartList.subscribe(

http://jsfiddle.net/jqq8y067/7/