Skip to content

Instantly share code, notes, and snippets.

@gregtyler
Last active August 29, 2015 14:17
Show Gist options
  • Save gregtyler/0f4a695997416dc8eeeb to your computer and use it in GitHub Desktop.
Save gregtyler/0f4a695997416dc8eeeb to your computer and use it in GitHub Desktop.
Potential definition template for UoE modules
/*** OLD ***/
(function($){
"use strict";
// Define namespace
uoe.namespace_for_this_mod = {};
// Define a function
function exampleFunctionIveCreated() {
alert( 'Please remove the exampleFunctionIveCreated function from your module.' );
}
// Expose to global scope
uoe.namespace_for_this_mod.exampleFunctionIveCreated = exampleFunctionIveCreated;
})(uoe.$);
/*** NEW ***/
(function(uoe){
"use strict";
// If using jQuery, require it inline as well.
// This won't load it twice, but ensures it's available
uoe.require('jquery1|jquery2',function(){
// Local-scope jQuery
var $ = uoe.$;
// Define namespace
uoe.namespace_for_this_mod = {};
// Define a function
function exampleFunctionIveCreated() {
alert( 'Please remove the exampleFunctionIveCreated function from your module.' );
}
// Expose to global scope
uoe.namespace_for_this_mod.exampleFunctionIveCreated = exampleFunctionIveCreated;
});
})(uoe);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment