I’m having a problem where my web service expects all RESTful urls to include a .json extension on the URL. I’ve made it so in my AngularJS code so that all URLs have that extension. So my service urls look like this:
/resources/:id.json
But the problem is that when I include the .json extension then the POST create restful action ends up posting to a URL that looks like:
/resources/.json
This throws an error.
What I need to do is set the defaults inside my AngularJS app to set .json just before each URL is returned. Any ideas on how to do this?
Since this doesn’t exist (yet) in AngularJS I had to fork a repo and add it myself.
Here’s the repo with this feature added.
https://github.com/yearofmoo/angular.js