I have a routing setup:
angular.module('MyApp', ['MyApp.controllers']). config(['$routeProvider', function($routeProvider) { $routeProvider.when('/foo', { templateUrl: '/fooTemplate', controller: 'FooCtrl' }); }] );
What I would like to do is prefix the path to '/ foo' at runtime, so depending on how my application is configured, the route might be / foo, maybe / some / arbitrary / path / foo, etc. d ..
Ideally, I could write something like:
... $routeProvider.when(prefix + '/foo', { templateUrl: '/fooTemplate', ...
But I canβt figure out how to insert this prefix into my configuration method.
source share