I'm new to automapper KO. I have this code:
var jData = [
{ "Id": 2, "Name": "A" },
{ "Id": 3, "Name": "B" },
{ "Id": 4, "Name": "C" }]
};
var viewModel = ko.mapping.fromJSON(JSON.stringify(jData));
ko.applyBindings(viewModel);
This code works:
<div data-bind="foreach : $data">
<input type="text" data-bind='value: Name' />
<br />
</div>
but if I want to select via a map:
<select id="prova" data-bind='options: $data, optionsText: "Name", optionsValue: "Id" , value: Id'></select>
I received this error
Enable to parse bindings. Message: ReferenceError: 'Id' is undefined; Bindings value: options: $data, optionsText: "Name", optionsValue: "Id" , value: Id
What's wrong? thanks L