I am using asp.net mvc 3 and knockoutjs 2.0 and mapping plugin
I have converted my model as json as below using mapping plugin
viewModel=ko.mapping.fromJS(@Html.Raw(Html.Serialize(Model)));
<div class="orders">
<div data-bind="foreach: JobOrder">
<div data-bind="text:$index">
</div>
</div>
</div>
my model is
public class Jobs : EntityBase
{
[MLLAttr(ObjectType = MLLObjectType.Child, IsCreate = true, ParentName = "Jobs", IsRequired = true)]
public List<JobOrder> JobOrder { get; set; }
}
$index is not working.
Thanks in advance
As Michael pointed out,
$indexwas introduced in knockout 2.1. You will need to update to use it