I am using $routeProvider
to set a route like
when('/grab/:param1/:param2', {
controller: 'someController',
templateUrl: "templates/someTemplate.html",
}).
Then in the someController
I can read the parameters with $routeParams.param1
.
How can I receive a JSON POST instead so I don´t have to use params in the URL ?
Is there something I can use in the controller e.g $request.postData
?
EDIT: I'll try to make it more clear
Instead of receiving param1
and param2
(that are in the URL of a GET call) and then use $routeParams
to read them and use them in my controller, I would like to receive a JSON object (which of course stays in a POST request) and have that object available in my controller.