This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EditableObj | |
constructor: (jsonData) -> | |
@hidden = -> # empty function where we will add properties that won't be exported with ko.toJS/ko.mapping.toJS | |
@update(jsonData) | |
update: (data) -> | |
console.log "*** update data=", data | |
# let ko.mapping create observable properties from the existing ones | |
ko.mapping.fromJS(data, {}, this) | |
@hidden.savedData = data | |
reset: -> |