问题
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:
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
来源:https://stackoverflow.com/questions/33508617/jquery-submit-replacement-with-angular