Within my application, I am in need of using routes that require multiple attributes from the URL to be passed into PHP.
The current setup that is functioning correctly is as follows:
.when('/jobs/:type', {
templateUrl: function(attrs){ return '/pages/jobs.php?_type=' + attrs.type; },
controller : 'jobsController'
})
This allows me to access _type
using a $_GET
request in jobs.php.
I am attempting to modify it so that I can include multiple attrs
in my template Url. Here's an example of what I have tried:
.when('/page/:data1/:data2', {
templateUrl: function(attrs){ return '/pages/page.php?data1=' + attrs.data1 + '&data2=' + attrs.data2; },
controller : 'mainController'
})
However, this adjustment is causing issues with my application. I believe there must be a simple solution to this problem, but due to my limited experience with Javascript and Angular, I cannot seem to figure it out.
Any help would be greatly appreciated. Thank you.