Knokout : Bind data object with select element's option

Monday, July 7, 2014

I am using KO MVVM for data binding along with Phonegap (running in ripple emulator), but facing issue in on thing. I am trying to bind selected value's object in select element. Here goes my code :


<select data-bind="options: pro(), optionsText: 'value', optionsValue: this, value: province"></select>


function screen1ViewModel()
var self = this; = ko.observableArray();
self.province = ko.observable();

$(document).ready(function () {
var vm = new screen1ViewModel();

var pro = [{
"symbol": "AB",
"value": "AB - Alberta"
"symbol": "BC",
"value": "BC - British Columbia"

$.each(pro, function(index, item) {;



For ex. if I select "AB - Alberta" from select list