Skip to content
Create a gist now

Instantly share code, notes, and snippets.

buildAnimal function
buildAnimal: function (model) {
var newAnimal = new Zoo.Animal();
if (model.hasOwnProperty("name")) {
newAnimal.setName(model.name);
}
if (model.hasOwnProperty("age")) {
newAnimal.setAge(model.age);
}
if (model.hasOwnProperty("hoursSinceLastFeed")) {
newAnimal.setHoursSinceLastFeed(model.hoursSinceLastFeed);
}
//return a Bindable object
return new WinJS.Binding.as(newAnimal);
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.