Artur2015-02-13 15:16:19
Artur, 2015-02-13 15:16:19

AngularJS and Symfony Forms or how to remove form action?

Angular doesn't do preventDefault() in ng-submit if the form has an action set, but Symphony adds an empty action even if it's removed from the form options.

Is there an elegant solution to this problem, or an option how to do preventDefault() for the form inside Angular.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Alex, 2015-02-13

Elegantly override the form_start block :)

TekVanDo, 2015-02-13

you can get (and cancel) the event by passing the event from the template - $event

<form ng-submit="$event..preventDefault(); action();">

<input type="submit">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question