Question: I'm facing an issue with the $routeProvider in my code. Here's my configuration:
$routeProvider
.when('/language/:countryCode', routing)
.when('/promotion/:promotionCode', routing)
.otherwise(routing);
}]);
The 'routing' variable points to a controller named registrationController, which contains the following initialise method:
$scope.initialise = function () {
console.log($routeParams);
}
When I access the URL in my browser:
mydomain/registration#/promotion/:free
The console displays:
Object {promotionCode: ":free"}
However, changing the URL to:
mydomain/registration#/language/:US-EN
The console outputs an empty object.
Can someone explain why, despite having the same routing setup, the language route isn't being recognized?