Last active
August 29, 2015 13:56
-
-
Save rymoore99/9098021 to your computer and use it in GitHub Desktop.
Basic Knockout Binding Demo
This file contains 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
<h4>Basic Knockout Binding Demo</h4> | |
<div> | |
<span data-bind="text:firstName"></span> | |
<span> </span><span data-bind="text:lastName"></span> | |
</div> |
This file contains 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(){ | |
function myModel() { | |
var self = this; | |
self.firstName = 'Benjamin'; | |
self.lastName = 'Franklin' | |
} | |
var viewModel = new myModel(); | |
ko.applyBindings(viewModel); | |
}); |
This file contains 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
name: Basic Knockout Binding Demo | |
authors: | |
- Ryan Moore | |
resources: | |
- http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment