I have an application which can run into two contexts -- 1) Global and 2) Client
When in global context the urls are like this mydomain.com/#login, mydomain.com/#register but when in client context the urls are like this mydomain.com/#/ClientKey/login and mydomain.com/#/ClientKey/register. In both contexts I want to open exactly the same template i.e login.html and register.html. One way to achieve this is to replicate routeProvider.when for both cases like the following
$routeProvider.when('/:ClientKey/_login', {
templateUrl: 'views/login.html',
controller: 'LoginCtrl',
})
$routeProvider.when('/_login', {
templateUrl: 'views/login.html',
controller: 'LoginCtrl',
})
My question is that is there is way to do it in a single routeProvider.when, instead of replicating it twice with only a small difference. This is important for my application because there are several such links like login, register, editProfile, changePassword etc.