OPTION ONE
You can set a variable (in your case the theme name) in the url and then access it in your routes:
.when('/blog/:themeName', {
templateUrl: function(params) {
return 'themes/'+ params.themeName +'/view/home.html',
}
This probably less suited to your situation though as it isn't ideal passing your theme name via the URL. I'd recommend option two...
OPTION TWO
You can use a provider to allow the setting of the theme name:
app.provider('themeConfig', function() {
this.name = 'Default';
this.$get = function() {
var name = this.name;
return name;
};
this.setName = function(name) {
this.name = name;
};
});
You can now inject the provider into your application config, set the theme and then use it in your routes.
app.config(['$routeProvider', 'themeConfigProvider',
function ($routeProvider, themeConfigProvider) {
themeConfigProvider.setName('mytheme');
$routeProvider
.when( '/this', { templateUrl: themeConfigProvider.name + '-this.html' })
.when( '/that', { templateUrl: themeConfigProvider.name +'-that.html' })
.when( '/other', { templateUrl: themeConfigProvider.name +'-other.html' })
.otherwise( { redirectTo: '/this' });
}]);
Working jsfiddle here: http://jsfiddle.net/3B5Sk/