I have a simple html form in a coldfusion application. Here is the code:
<form id="form1" name="form1" method="post" action="myAngularApp/#/myapp/new">;
<input name="data" type="hidden" id="hiddenField" value="<cfoutput>#form.data#</cfoutput>" />
</form>
<script> document.form1.submit(); </script>
The Url in 'Action' points to a different server that hosts an angular app (running on nodejs). Also I use full path including http (removed above for brevity) in Url. When I click submit, it goes to the other site but shows 'Cannot POST /' message. If I access the same link directly in a new browser window, the page loads fine. If I replace POST with GET method, then the destination page loads but immediately redirects the user to login page for authentication and when user comes back, the data posted (available as querystring) is lost. Angular app is a hybrid app (Angular version 4.4 and 1.6; node version 9.x). How do I make POST work? I am not using express. Most of the links I found while searching online show express examples but I dont use express. Do I need to use ngRoute? Since it's a hybrid app, I am not sure whether to use angular-route (ngRoute) or angular-router. If the destination page loads directly in browser, why does not it load when redirected from the other server?