Take the 2-minute tour ×  I've got my routing setup like this:
angular.module('MyApp', ['MyApp.controllers']).
$routeProvider.when('/foo', {         templateUrl:
'/fooTemplate',         controller: 'FooCtrl'  What I'd like to
do is prefix a path to '/foo' at runtime, so depending on how my
app is configured, the route might be /foo, might be
/some/arbitrary/path/foo, etc.  Ideally I could write something
like:  $routeProvider.when(prefix + '/foo', {     templateUrl:
'/fooTemplate',  But cannot figure out how to inject that prefix
into my config method.  share|improve this question  1 Answer 1
up vote 3 down vote accepted  It should be something like:
.when('/:prefix/foo', {templateUrl: 'details.html', controller:
DetailsCtrl})  The prefix will then be available in the
controller through $routeParams. If you would like it to handle
the option foo without a prefix just simply place it in the
routing and make sure it is before the example above.
.when('/foo', {templateUrl: 'details.html', controller: Det