I've got routing that looks like this:
.when "/:locale",
templateUrl: "/views/index.html"
...
.otherwise redirectTo: "/en"
The issue is that the first route also matches /
. Is there a way to add required route segments, so that /:locale
would only match if there's actually non-empty string?
I could probably listen to $routeChangeStart
and implement otherwise
condition there, but it would be much easier if I could do it all in a single place.