You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
Submitting a form and preventing the default action
[...]
For this reason, Angular prevents the default action (form submission to the server) unless the <form> element has an action attribute specified.
Yet, if you specify <form action="">...</form>, angularjs consider that no action attribute is specified, which is not true.
The test condition in src/ng/directive/form.js is not strict enough (in the form directive)
if (!attr.action) {
I'm no JS expert, but I think a stricter comparison would be more appropriate (such as the following)
if (typeof attr.action === 'undefined') {
The text was updated successfully, but these errors were encountered:
A lot of us are mixing Angular into our traditional site frameworks rather than full SPAs, so the fact that all form tags get auto-directive'd causes a lot of unexpected issues like these.
An even better fix (I think) would be removing ngForm's form alias (or allowing us to via module configuration) and making all forms opt-in via ng-form='' attributes, although I imagine it's too much of a breaking-change for a minor update.
Maybe a <form ng-form-ignore='' >... that prevents the controller from binding/initializing at all?
ngForm still has some growing up to do (ex. validation on dynamically named inputs) and it's a real bummer when it interferes with our non-angular functionality.
Hi,
The current code/documentation (http://docs.angularjs.org/api/ng.directive:form) says the following about a form default action:
Yet, if you specify
<form action="">...</form>
, angularjs consider that no action attribute is specified, which is not true.The test condition in src/ng/directive/form.js is not strict enough (in the form directive)
I'm no JS expert, but I think a stricter comparison would be more appropriate (such as the following)
The text was updated successfully, but these errors were encountered: