Skip to content Skip to sidebar Skip to footer

Fetching Data Using .getjson And Storing Using Knockout.js

My TweetModel is setup like this function TweetModel(tweet) { var self = this; this.tweet = ko.observable(tweet); } [UPDATED] Running into trouble binding the solutio

Solution 1:

Try this:

$.getJSON(someurl, function (data) {
    $.each(data.key, function (i, val) {
        self.tweets.push(new TweetModel(val));
    }
}

Post a Comment for "Fetching Data Using .getjson And Storing Using Knockout.js"