在AngularJS中获取调用表单的action属性

时间:2013-04-28 05:43:09

标签: forms angularjs

我有表格

<form name="form" ng-submit="submit()" action="<?php echo Route::get('auth'); ?>" ng-controller="LoginCtrl">
  <!-- the rest -->
</form>

和coffeescript部分

app.controller 'LoginCtrl', ($scope) ->
  $scope.submit = (where) ->
    # want to the get the form action here

是否有任何“角度”方式来获取表单DOM元素或表单的操作。我无法对Javascript文件中的操作进行硬编码,因为它会根据当前的uri而更改。

1 个答案:

答案 0 :(得分:0)

Angular不支持它,因为我正在使用jQuery,我只是按id选择表单...太糟糕了AngularJS没有将元素传递给控制器​​,仅用于指令。