title: Referencing parent class in CoffeeScript from a jQuery callback
body: <p>I'm new to CoffeScript and I was wondering if there's a way of writing the following piece of code without referencing the global variable app:</p>
  
  <pre><code>class App 
  
      constructor: -&gt;
          @ui = ui.init()
          $('#content-holder a[rel!=dialog]').live 'click', -&gt;
              link = $(@).attr 'href'
              app.loadUrl link
              return false
  
      loadUrl: (href) -&gt;
          # ...
  
  app = new App()
  </code></pre>
  
  <p>Using the fat arrow doesn't work, as then I lose reference to the jQuery object, i.e.</p>
  
  <pre><code>class App   
      constructor: -&gt;
          @ui = ui.init()
          $('#content-holder a[rel!=dialog]').live 'click', =&gt;
              # @ now references App
              link = $(@).attr 'href'
              this.loadUrl link
              return false
  
      loadUrl: (href) -&gt;
          # ...
  </code></pre>
  
  <p>The first piece of code works, but I want to get rid of the global variable if possible :-)</p>
  
  <p>Cheers,
  Gaz.</p>