<table> <tbody data-bind="foreach: showinTable"> <tr> <td> <input data-bind="value: proudctID" /> </td> <td> <input data-bind="value: proudctName" /> </td> </tr> </tbody> </table>
$.getJSON("/api/Product/GetProducts", null, function (data, status, jqxhr) { //alert(data.products) self.showinTable = ko.mapping.fromJSON(data); ko.applyBindings(new AppViewModel()); });
Uncaught Error: Unable to parse bindings. Message: ReferenceError: showinTableis not defined; Bindings value: value: foreach
{"products":[{"proudctID":1,"proudctName":"Product One"},{"proudctID":2,"proudctName":"Product Two"},{"proudctID":3,"proudctName":"Product Three"},{"proudctID":4,"proudctName":"Product Four"},{"proudctID":5,"proudctName":"Product Five"}]}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)