Skip to content

Instantly share code, notes, and snippets.

Created September 30, 2010 13:53
Show Gist options
  • Save anonymous/604596 to your computer and use it in GitHub Desktop.
Save anonymous/604596 to your computer and use it in GitHub Desktop.
var baseController = {
baseObject: this(??),
item: {
render: function(u){..}
},
itemList: {
render: function(il){
il.forEach(function(v,i,a){
???.item.render(v);
}
}
}
}
userController = clone(baseController);
groupController = clone(baseController);
How should I structure the code to be able to reach 'baseController' from anywhere down the hierarchy?
Update, I realize that the var with the name 'baseController' is available in this example, however I would like to be able to not be dependent on the naming of the object literal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment