title: using new within the define module requirejs
body: <p>I have been defining my controllers like this for a while(without any lib) but the dependencies drove me crazy and now I'm trying to integrate requireJs.</p>
  
  <pre><code>controller = new function () {
  
      this.test = "Hello World";
  
      this.__construct = function () {
         alert(this.test);
      };
  
      this.__construct();
  
  };
  </code></pre>
  
  <p>How can one transform this to a requireJs Module? I have tried the following</p>
  
  <pre><code>define(function () {
  
     return controller = new function () {
  
         this.test = "Hello World";
  
         this.__construct = function () {
             alert(this.test);
         };
  
         this.__construct();
      };
  
  });
  </code></pre>
  
  <p>Could I simply do ?</p>
  
  <pre><code>define(controller);
  </code></pre>
  
  <p>In My Main</p>
  
  <pre><code>//main.js
  requirejs(['controller']);
  </code></pre>
  
  <p>However, the alert popup wont show up.</p>