var content = function(data){ var self = this; self.id = ko.observable(); self.type = ko.observable(); self.category = ko.observable(); self.title = ko.observable(); self.content = ko.observable(); if (data) { self.update(data); } } content.prototype.update = function(data) { this.id(data.id); this.type(data.type); this.category(data.category); this.title(data.title); this.content(data.content); };