0
null value of observable array when i use this code how can i solved

self.items = ko.observableArray([]);
var jsonText = JSON.stringify({ myColumns: self.items() });

in quick watch i see that {"myColumns":[{}]} but array is fulled from obseravble property

1 Answer 1

1

Try using the built in ko.toJSON method (See http://knockoutjs.com/documentation/json-data.html)

var jsonText = ko.toJSON(self);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.