Reputation: 5681
I can find very little about this specific subject of angularJS.
How can I specify and rewrite all urls with a locale id, like en-uk
, nl-nl
?
I also want to use proper routing to automate the process and providing the locale id to the corresponding controllers.
A few examples:
Home
and provide the locale id en-uk
Home
and provide the locale id nl-nl
Shop
and provide the locale id en-uk
Shop
and provide the locale id nl-nl
Question: How is this done in angularJS?
Upvotes: 0
Views: 537
Reputation: 28750
You can configure the $routeParams to have the locale as the first section:
$routeProvider
.when("/:local/home", { controller: "HOME_CONTROLLER" ... })
.when("/:local/shop", { controller: "SHOP_CONTROLLER" ... })
Here's the documentation on it: http://docs.angularjs.org/api/ngRoute.$routeParams
Upvotes: 1