I am new to knockout.js. I wasn't able to bind data from api to dropdown using knock out js.
My Json data from api and dropdown is:
[{
ContactID: 0,
FirstName: "Aaa",
LastName: "bbb",
MobileNumber: null,
StartDate: "0001-01-01T00:00:00",
EndDate: "0001-01-01T00:00:00"
},
{
ContactID: 0,
FirstName: "Ccc",
LastName: "ddd",
MobileNumber: null,
StartDate: "0001-01-01T00:00:00",
EndDate: "0001-01-01T00:00:00"
}
]
<select id="selectmenu1" name="" data-theme="c" data-bind="optionsCaption: 'Choose...'"> </select>
I just to bind firstname,lastname,contactID to dropdown and display firstname and lastname as text and contactID is the value field for that item. Could anyone please give some suggestions regarding this?