I have a quick question about the AngularJS routing. As we know that we can do the routing as follows:
$routeProvider
.when('/dashboard', {
templateUrl : 'dashboard.htm',
title : 'Dashboard'
})
.when('/settings', {
templateUrl : 'settings.htm',
title : 'Settings'
})
.otherwise({
templateUrl : 'error-page.htm',
title : 'Page Not Found'
});
Here I need to do multiple rouging for the single templateURL, I wanted to to something like shown below:
$routeProvider
.when('/dashboard || /', { /* Here doing OR for "/dashboard" and "/" */
templateUrl : 'dashboard.htm',
title : 'Dashboard'
})
.when('/settings', {
templateUrl : 'settings.htm',
title : 'Settings'
})
.otherwise({
templateUrl : 'error-page.htm',
title : 'Page Not Found'
});
Is there any way to do that in AngularJS routing? I do not want to make one more .when for the second part.