I am implementing AngularJS on an existing web application that requires a common HTTP POST like you would do without AngularJS.
This seems to be more difficult than I expected. The page URL is dynamically generated and cannot be echoed using PHP. I tried modifying the form action using jQuery but that doesn't seem to work either.
Is it really impossible to submit a form the normal way? This is what I mean with a normal form:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form method="post">
<input type="text" name="txt">
<input type="submit" name="submit">
</form>
</body>
</html>
And this is the same form with AngularJS:
<!DOCTYPE html>
<html ng-app>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
</head>
<body>
<form method="post">
<input type="text" name="txt">
<input type="submit" name="submit">
</form>
</body>
</html>
The first form performs a regular form post, the second form doesn't. According to http://docs.angularjs.org/api/ng.directive:form this is by design and I can provide the "action" parameter in the form. Leaving it empty doesn't work and modifying it by using jQuery doesn't seem to work either.
$_SERVER['QUERY_STRING']
or the like to echo the current url? If you can't set the action then afaik your only option would be to run a custom version of the angular code with this 'feature' removed. – Storehouse