jQuery .submit() replacement with angular?

2019-09-04 15:26发布

Is there angular event trigger function, like we have with jQuery for following action?

$('.link').click(function () {
    $('form').submit(); // this will submit form 
});

Please note, that this is not onSubmit function which is mostly <form ng-submit="submit()"/>

1条回答
劫难
2楼-- · 2019-09-04 15:59

You can use ng-click to call a function in your controller to execute form submission.

$('form').submit()

using jQuery

or

document.getElementById('someForm').submit()

using JavaScript

查看更多
登录 后发表回答