Angular.js submit form old way

后端 未结 3 548
逝去的感伤
逝去的感伤 2020-12-09 02:42

I\'m migrating an old html page from jQuery to Angular, and it contains some old-school forms with . When I enriched my pages with

3条回答
  •  借酒劲吻你
    2020-12-09 03:29

    • Use a non-empty action attribute to make Angular submit the form
    • Fill action attribute with current location (using angular)

    In your controller:

    $scope.location = $window.location.href
    

    In your HTML:

    See the plunkr demo.

提交回复
热议问题