I am trying to localize everything in a namespace in javascript. Therefore, I have objects that follow the naming convention:
myapp.utilities.file.spinner
etc...
My question is, is there a way to avoid repeating this big line every time I want to enlarge an object using a property or method. Currently, my code looks like this ...
myapp.utilities.file.spinner.method1 = function() { }; myapp.utilities.file.spinner.method2 = function() { }; etc.
Something like that...
spinnerPath.method1 = function()
... where spinnerPath means myapp.utilities.file.spinner , it would be better. But from my understanding I can’t just say
spinnerPath = myapp.utilities.file.spinner
as this will create another object in global space.
thanks
source share