Last active
August 29, 2015 14:01
-
-
Save mauriciosoares/ace667c6ac8e2000e962 to your computer and use it in GitHub Desktop.
This file contains 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 App = App || {}; | |
Module = function(ns_string) { | |
var parts = ns_string.split('.'), | |
parent = App, | |
i; | |
if(parts[0] == 'App') { | |
parts = parts.slice(1); | |
} | |
for(i = 0; i < parts.length; i += 1) { | |
if(typeof parent[parts[i]] === 'undefined') { | |
parent[parts[i]] = {}; | |
} | |
parent = parent[parts[i]]; | |
} | |
} | |
Module('App.Ueba.Hue'); | |
Module('App.Ueba.Alan'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment