Skip to content

Instantly share code, notes, and snippets.

@yreynhout
Created August 5, 2012 09:45
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 yreynhout/3263501 to your computer and use it in GitHub Desktop.
Save yreynhout/3263501 to your computer and use it in GitHub Desktop.
Viewmodels - Sample 4
var PageViewModel = function() {
if(!this instanceof PageViewModel) {
return new PageViewModel();
}
var self=this;
self.Navigation=new NavigationViewModel();
self.List=new ListViewModel();
self.Detail= new ThingDetailViewModel();
self.enable=function() {
self.Navigation.enable();
self.List.enable();
self.Detail.enable();
};
self.disable=function() {
self.Navigation.disable();
self.List.disable();
self.Detail.disable();
};
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment