Created
September 30, 2010 13:53
-
-
Save anonymous/604596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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