title: How to resolve "module is not defined."
body: <p>I have a module that I'm using elsewhere, but I keep getting "module is not defined." It works if I use the global directive but that implies that the module is defined elsewhere. Is there any way to fix this issue? Thank you</p>
  
  <p>In <code>module.js</code></p>
  
  <pre><code>/* exported module */
  var module = (function($){
     ...
     return {method: method};
  })($);
  $(module.method);
  </code></pre>
  
  <p>In <code>foo.js</code></p>
  
  <pre><code>var foo = function() {
       function bar() {
           module.method();
       }
  };
  $(foo);
  </code></pre>