I currently have an operational angular form embedded within a rails app. It successfully sends a get request to the rails server.
However, I am facing an issue where if the app receives a normal get request, the page refreshes. But when the request is sent through angular, although it reaches the server, the page does not refresh (even though I can retrieve data using these get requests).
My query is regarding how to pass a get request in an angular form so that the server can process it as usual and trigger a page refresh.
The HTML code snippet:
<form ng-submit="submitForm()" style="margin-top:30px;">
<h3>get request</h3>
<button type="submit" class="btn btn-primary">Get</button>
</form>
The controller code in app.js:
$scope.submitForm = function(){
posts.factorySubmit();
};
The factory get function in app.js:
o.factorySubmit = function() {
$http.get('http://localhost:8080/clients');
};
--Side note - Interestingly, creating a get request with regular JavaScript in the app (outside of the angular context) results in the expected behavior of page refreshing.