I have a service that makes a simple POST:
saveVersion: function(styleGuideId, data){
return $http({method: 'post', url: '/style_guides/' + styleGuideId + '/new_version', data: data}).then(function(project){
console.log('request completed')
});
},
In the console, if I fire this request, it works fine.
But when I click a button in my ui that makes this request, I see on my server the request gets completed with a 200 but on the client side the browser says it is cancelled.

The extra GET is also a mystery. In the console, I trigger the request like this:
angular.element(document.body).injector().get('StyleGuides').saveVersion(sg_id, data)
//sg_id and data are local variables that I got like this:
sg_id = angular.element($0).scope().project.style_guide_id
Just figured it out. Stupid Mistake
The button that triggers the save looked like this:
<a href="javacript://" ng-click="saveVersion()">Save</a>
See the typo? changing javacript:// to javascript:// fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With