WIP
This commit is contained in:
25
transcodetest/webroot/js/Message.js
Normal file
25
transcodetest/webroot/js/Message.js
Normal file
@@ -0,0 +1,25 @@
|
||||
define(
|
||||
"Message",
|
||||
[],
|
||||
function() {
|
||||
|
||||
function Message(model) {
|
||||
if (model !== undefined) {
|
||||
this.author = ko.observable(model.author);
|
||||
this.body = ko.observable(model.body);
|
||||
} else {
|
||||
this.author = ko.observable("Anonymous");
|
||||
this.body = ko.observable("");
|
||||
}
|
||||
|
||||
this.toModel = function() {
|
||||
return {
|
||||
author: this.author(),
|
||||
body: this.body()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return Message;
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user