0
我有一個問題來映射我的JCF對象返回的WCF。 WCF返回PaidPeople類的列表,和JSON回報看起來像敲除映射wcf
[Object { __type="PaidPeople:#model", Amount=110, Attendee=1, more...}, more...]
我也JSON.stringify返回的對象,我也得到
[
{"__type":"PaidPeople:#model","Amount":110,"Attendee":1,"CashPay":1,"DtPaid":"/Date(1338102000000-0700)/","Name":"John Doe"}, more
]
我的問題的陣列將其映射到我的觀點
這裏是代碼
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
和HTML正在尋找這樣的:
<div data-bind="foreach: ????">
<h3 data-bind="text: Name">
</h3>
<p>
Name: <span data-bind="text: Name"></span>
</p>
</div>
我剛開始使用jquery代碼進行基因敲除後,很喜歡它,但我錯過了很多練習。任何幫助將不勝感激
非常感謝我之前做過嘗試PayinyVM.model,但無法看到您的解決方案。再次感謝 –