Skip to content

Instantly share code, notes, and snippets.

@skinofstars
Created May 8, 2012 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skinofstars/2634670 to your computer and use it in GitHub Desktop.
Save skinofstars/2634670 to your computer and use it in GitHub Desktop.
function Challenge(name){
var self = this;
self.name;
}
function GBKAuthedViewModel() {
var self = this;
// other stuff...
self.challenges = ko.observableArray([new Challenge('challenge1'),new Challenge('challenge2')]);
// then in the view
<ul class="challenge-list" data-bind="foreach: challenges">
<li data-bind="text: name"></li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment