Skip to content

Instantly share code, notes, and snippets.

@johndobrien
Created October 18, 2013 17:47
Show Gist options
  • Save johndobrien/7045287 to your computer and use it in GitHub Desktop.
Save johndobrien/7045287 to your computer and use it in GitHub Desktop.
var Member = function() {
this.FirstName = ko.observable("");
this.LastName = ko.observable("");
this.Email = ko.observable("");
this.DisplayName = ko.computed(this.getDisplayName, this);
};
CurrentUser.prototype.getDisplayName = function () {
return this.FirstName + " " + this.LastName;
};
CurrentUser.prototype.update = function(response) {
this.FirstName(response.Member.FirstName);
this.LastName(response.Member.LastName);
this.Email(response.Member.Email);
};
CurrentUser.prototype.reset = function() {
this.FirstName = ko.observable("");
this.LastName = ko.observable("");
this.Email = ko.observable("");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment