Unable to send json data using durandal JS using Knockout Binding
var xyz= {
a: ko.observable(),
b: ko.observable(),
c: ko.observable(),
d: ko.observable()
};
function setupControlEvents()
{
$("#save").on("click",handleSave);
}
function handleSave()
{
var data = ko.toJSON(xyz);
//alert("data to send "+data);
//var d = serializer.serialize(data);
url ="../save";
http.post(url,data).then(function(){
alert("success");
console("save was success");
});
I am able to get the data but unable to save .. when i alert the data that
i am sending i get this data to send
{"a":"A","b":"B","c":"C","d":"D","observable":{"full":true}}
i tried to serialize with durandal's serialize.serialize() but still not
working .. i think i am unable to send the data because i am getting
obserbvable in json data so please kindly help me to solve this..
No comments:
Post a Comment