Can I trigger a form submit from a controller?

后端 未结 6 1487
独厮守ぢ
独厮守ぢ 2020-12-05 00:04

I\'d like to do a traditional form submit from within a controller. The scenario is that I want to hit a route on my web server and redirect to its response, which I can do

6条回答
  •  隐瞒了意图╮
    2020-12-05 00:57

    $scope.payForm.$setSubmitted();
    

    Sets the form to its $submitted state. This will also set $submitted on all child and parent forms of the form

    https://docs.angularjs.org/api/ng/type/form.FormController#$setSubmitted

提交回复
热议问题