Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/376.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用Angular在coffeescript中指定变量_Javascript_Angularjs_Coffeescript - Fatal编程技术网

Javascript 使用Angular在coffeescript中指定变量

Javascript 使用Angular在coffeescript中指定变量,javascript,angularjs,coffeescript,Javascript,Angularjs,Coffeescript,我正在尝试将angular.js集成到pubnub webrtc示例中,发现: 下面是我尝试与angular一起使用的表单,用于为webrtc大厅指定名称: <form ng-controller="ctrl" ng-submit="submit()"class="box"> <div> <input type="text" id="userid" placeholder="Username" ng-model="text" />

我正在尝试将angular.js集成到pubnub webrtc示例中,发现:

下面是我尝试与angular一起使用的表单,用于为webrtc大厅指定名称:

<form ng-controller="ctrl" ng-submit="submit()"class="box">
        <div>
        <input type="text" id="userid" placeholder="Username" ng-model="text" />
        <br />
        <a href="#" type="submit" class="btn btn-large btn-inverse" id="login">Log In</a>
        </div>
</form>

那些不是全球性的。这些都是该函数的本地函数,除了您显式指定给
窗口的函数之外。为什么要在angular中使用jQuery?示例中给出了jQuery,我目前正在尝试更改它@jcubic如果您对coffeescript有疑问,最好的答案是编译并查看结果。若问题是关于角度的,请提供角度代码。
$(document).ready () ->
  # Globals
  # =================
  window.pubnub = null
  uuid = null
  currentCall = null
  myStream = null
  plusClient = null

  # Login
  # ================

  document.querySelector('#login').addEventListener 'click', (event) ->
    uuid = document.querySelector('#userid').value
    login "guest-#{uuid}"

  login = (name) ->
    uuid = name