Skip to content

Instantly share code, notes, and snippets.

@markomanninen
Created November 18, 2011 13:40
Show Gist options
  • Save markomanninen/1376487 to your computer and use it in GitHub Desktop.
Save markomanninen/1376487 to your computer and use it in GitHub Desktop.
Cannot find module './widgets/G'
root.load = (apis) ->
for api in apis
eval('root.'+api+' = require("./widgets/'+api+'").'+api)
return this
@markomanninen
Copy link
Author

root.load = function(apis) {
var api, _i, _len;
for (_i = 0, _len = apis.length; _i < _len; _i++) {
api = apis[_i];
eval('root.' + api + ' = require("./widgets/' + api + '").' + api);
}
return this;
};

@markomanninen
Copy link
Author

yea, my apis argument wasn't an array, thats why error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment