title: singleton in ExtJs4
body: <p>I want to create a singleton object in Ext JS 4.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Ext.define('AM.model.Test', {
      extend : 'Ext.util.Observable',
      singleton : true,
      foo : function() {
          console.log('log 1');
      },
      constructor : function() {
  
      }
  });
  </code></pre>
  
  <p>I call it with:</p>
  
  <pre><code>AM.model.Test.foo();
  </code></pre>
  
  <p>It all works fine as long as I place define in app.js.
  When I try to move this definition to 'app\model\Test.js' I get this error:</p>
  
  <blockquote>
    <p><code>AM.model.Test is undefined [Break On This Error]</code><br>
    <code>AM.model.Test.foo();</code></p>
  </blockquote>
  
  <p>What's wrong with my code?</p>