title: Assigning variables in coffeescript using Angular
body: <p>I am trying to integrate angular.js into the pubnub webrtc example found <a href="http://webrtc.co/" rel="nofollow">here</a>:</p>
  
  <p>Below is a form that I am trying to use with angular to assign a name for a webrtc lobby:</p>
  
  <pre><code>&lt;form ng-controller="ctrl" ng-submit="submit()"class="box"&gt;
          &lt;div&gt;
          &lt;input type="text" id="userid" placeholder="Username" ng-model="text" /&gt;
          &lt;br /&gt;
          &lt;a href="#" type="submit" class="btn btn-large btn-inverse" id="login"&gt;Log In&lt;/a&gt;
          &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>How would I assign the string given by a user via the input(using Angular.js rather than the coffeescript shown), so that it is able to be used within the scope of my coffeescript file below? I would then like a hint on how to further display the given login name in another html element. Any help would be greatly appreciated. I understand the form from the example is somewhat poorly written.</p>
  
  <p>I have the following coffee  script to grab from input a uuid via the form above:    </p>
  
  <pre><code>$(document).ready () -&gt;
    # Globals
    # =================
    window.pubnub = null
    uuid = null
    currentCall = null
    myStream = null
    plusClient = null
  
    # Login
    # ================
  
    document.querySelector('#login').addEventListener 'click', (event) -&gt;
      uuid = document.querySelector('#userid').value
      login "guest-#{uuid}"
  
    login = (name) -&gt;
      uuid = name
  </code></pre>