Skip to content

Instantly share code, notes, and snippets.

@pbouzakis
Last active December 27, 2015 02:19
Show Gist options
  • Save pbouzakis/7251520 to your computer and use it in GitHub Desktop.
Save pbouzakis/7251520 to your computer and use it in GitHub Desktop.
function itemMapper(parentCourse) {
return function (item) {
return new itemViewModel(item, parentCourse);
};
}
// later
var firstCourse = terms[0].courses[0];
// inside your object literal
observableArrayFromVector(firstCourse.items, itemMapper(firstCourse))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment