I am using AngularJS for my client side framework. Using the routeprovider, I want to sent query params to my templateURL for processing. Basically my templateURL is a server side php script which will generate HTML.
Now routeprovider is not sending query params to my server side code. I am getting blank values for all such params.
If my approach is wrong, please correct me.
The way Angular is meant to be used is that the client requests the content as JSON from the server (with the $http module) and then the HTML is built on the client-side. See what-is-the-point-of-angularjs-routes? I also highly recommend the official tutorial.
I would recommend against having your server render your HTML for you... but I suppose if you had to do things this way, you could just leverage ng-include:
When you set up your route:
$routeProvider.when('/route/:id', {
template: '<div ng-include="/Some/Url?id={{id}}"></div>',
controller: 'FooCtrl'
});
Then your controller:
app.controller('FooCtrl', function($scope, $routeParams) {
$scope.id = $routeParams.id;
});