In my code, I have a form that looks like this:
<form action="" method="post">
By default, AngularJS disables form submissions without an action attribute specified. I understand I can (and should) assign a form action, however I'd like to know if there's a simple way to prevent AngularJS from intercepting this specific form submission event so that it can post normally.
In my code, I have a form that looks like this:
<form action="" method="post">
By default, AngularJS disables form submissions without an action attribute specified. I understand I can (and should) assign a form action, however I'd like to know if there's a simple way to prevent AngularJS from intercepting this specific form submission event so that it can post normally.
Share Improve this question asked Feb 5, 2013 at 15:46 Mike RobinsonMike Robinson 25.2k8 gold badges63 silver badges83 bronze badges 8-
1
Post to where?
action=""
is the same as no action at all. – Ben Lesh Commented Feb 5, 2013 at 15:47 - 1 action="" will post to the current page – Mike Robinson Commented Feb 5, 2013 at 15:49
- I'm still confused, what are you trying to do? – Ben Lesh Commented Feb 5, 2013 at 16:01
- I think you're trying to get forms with action="" to behave like other forms in angular? If so, I have an answer, if not, disregard. – Ben Lesh Commented Feb 5, 2013 at 16:06
- I'm trying to get the form to post back to itself. If the form is on a page with the URL of "/users", it normally posts back to "/users". However, AngularJS prevents that from happening (see documentation). I want to tell AngularJS that it actually should act like a normal form, and post back to itself. – Mike Robinson Commented Feb 5, 2013 at 16:08
1 Answer
Reset to default 12Use action="?"
... Angular is checking !attr.action
, which if action == "", is true.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1741405745a4345225.html
评论列表(0条)