我正在尝试将视图模型序列化为 json,但我只undefined
参与ko.toJSON(PageViewModel)
其中。任何想法?
function PageViewModel() {
//Properties
this.Name = ko.observable();
this.Title = ko.observable();
this.Language = ko.observable();
//Seo
this.SEOKeywords = ko.observable();
this.SEODescription = ko.observable();
this.SEOIndexPage = ko.observable();
this.SEOGeoPositionLatitude = ko.observable();
this.SEOGeoPositionLongitude = ko.observable();
this.SEOGeoPositionPlaceName = ko.observable();
this.SEOGeoPositionRegion = ko.observable();
}
ko.applyBindings(new PageViewModel());
window.loadFirebugConsole;
console.log(ko.toJSON(PageViewModel));
谢谢米克