As title, I would like to use AngularJS to generate a link that works like a submit button of a form.
In Rails, I can achieve this by the link_to
method: link_to "Cancel", bookings_path(@booking), :method => "DELETE"
. And then Rails will generate a hidden form for me to simulate form submitting when the link is clicked.
Is there any AngularJS directive can do this for me?
[EDIT]
What I want is a pure Angular way for this:
/ in some haml file
= link_to "Cancel", nil, :method => 'DELETE', :"ng-href" => "/bookings/{{id}}/"
I am not sure, but may be this will help you,