knockout.js - Knockout mapping wcf -


i have problem map json object returned wcf. wcf return list of paidpeople class, , json return

[object { __type="paidpeople:#model", amount=110, attendee=1, more...},  more...] 

i json.stringify return object , array of

[ {"__type":"paidpeople:#model","amount":110,"attendee":1,"cashpay":1,"dtpaid":"/date(1338102000000-0700)/","name":"john doe"}, more ] 

my problem mapping view

here code

  var payinyvm = {};      $.getjson('/service/paidservice.svc/paidlist', function (data) {         var tmp = json.stringify(data.d);          payinyvm.model = ko.mapping.fromjson(tmp);         ko.applybindings(payinyvm);     }); //getjson 

and html looking like:

   <div data-bind="foreach: ????">         <h3 data-bind="text: name">         </h3>         <p>             name: <span data-bind="text: name"></span>         </p>     </div> 

i started coding knockout after long time jquery code, , it, miss lot of practice. appreciated

try use following code (model instead of ????):

<div data-bind="foreach: model">     <h3 data-bind="text: name">     </h3>     <p>         name: <span data-bind="text: name"></span>     </p> </div> 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -