I am trying to perform conversion of property to observable with the use of komapping plugin.
I do have array of same kind of objects like below:
var data =[{ b1: "v1", b2: "b21" }, { b1: "v2", b2: "b22" }] ;
Now I wanted to property b1 as if and b2 to be converted to observable with the use of komapping. For simplicity I have kept here only two properties but in realty I do have more properties.
so I tried it like following:
var data = [{ b1: "v1", b2: "b21" }, { b1: "v2", b2: "b22" }] ;
var result = ko.mapping.fromJS(data, { copy: "b1" });
console.log(result());
But it does not work here is the jsfiddle