How to update an object from knockoutjs?

I’m using knockoutjs to bind data to table, and I want to update object at user click. Here is my code

    var Books = [{Book:"Harry Potter",Author:"J.K rowling"},{Book:"5 Point Someone",Author:"Chetan Bhagat"},{Book:"I too had a love story",Author:"Ravinder Singh"}];

    var appViewModel = function() {
        this.firstName = ko.observable("Amit");
        this.Books = ko.observableArray([]);
        this.updateBook = function() {
            this.Book("Harry Potter and Prisoner of Azkaban");

But it get error: “Uncaught TypeError: string is not a function”. How can fix it ?


Source: jquery

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.