So this is what I am trying to accomplish:
\'use strict\';
var app = angular.module(\'myModule\', [\'ngRoute\']);
app.config(function($routeProvider) {
$
templateUrl can be use as function with returning generated URL. We can manipulate url with passing argument which takes routeParams.
See the example.
.when('/:screenName/list',{
templateUrl: function(params){
return params.screenName +'/listUI'
}
})
Hope this help.
templateUrl
can be a function accepting object of route parameters:
.when('/pages/:pageName', {
templateUrl: function(params) {
return 'views/pages/' + params.pageName + '.html';
},
controller: 'MainController'
});