Created
August 19, 2012 16:53
-
-
Save bjartwolf/3396220 to your computer and use it in GitHub Desktop.
buster 201 src
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
function AppViewModel() { | |
var self = this; | |
self.firstName = ko.observable("Bert"); | |
self.lastName = ko.observable("Bertington"); | |
self.fullName = ko.computed(function () { | |
return self.firstName() + " " + self.lastName(); | |
}, self); | |
self.capitalizeLastName = function () { | |
var currentVal = self.lastName(); // Read the current value | |
self.lastName(currentVal.toUpperCase()); // Write back a modified value | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment