My view:
-
Silliest mistake ever, make sure you are compiling your js code.
讨论(0)
-
Even if the button is inside the form and still ng-submit
is not working then change your button type
to submit.
<button type="submit" class="btn btn-success" ng-click="login()">Login</button>
P.S: Other answers did not help me until I changed the button type to submit
. Hope this helps.
讨论(0)
-
Thanks to Matt Way's comment - turns out my save button was outside my form. Fixed
讨论(0)
-
This affects too, there has to be a submit button in the form (button or input type="submit") or ng-submit won't work.
讨论(0)
-
Maybe you should add 'novalidate' attribute on the form tag to avoid native browser validation as indicated here https://docs.angularjs.org/guide/forms
讨论(0)
-
for me the problem was 'required' tag on one of the form fields. After removing this tag the form worked again. The old way of solving such problems is to try to comment part of your form and to run the code.
I prefer using 'novalidate' tag on the form, and button with type="submit" , so that the validation of the form is done by angular.
讨论(0)
- 热议问题