title: dynamic templateUrl with param using angular-ui-router
body: <p>I have a route to handle creation, modification, view and list of users like this :</p>
  
  <pre><code>angular
    .module('abcApp', ['ui.router'])
    .config(function ($stateProvider, $urlRouterProvider) {
      $stateProvider
        .state('user.add', {
          url: '/mgt/user/add',
          templateUrl: 'views/mgt_user/add.html',
          controller: 'MgtUserCtrl'
        })
        .state('user.view', {
          url: '/mgt/user/view/:userId',
          templateUrl: 'views/mgt_user/view.html',
          controller: 'MgtUserCtrl'
        })
        .state('user.list', {
          url: '/mgt/user/list',
          templateUrl: 'views/mgt_user/list.html',
          controller: 'MgtUserCtrl'
        });
    });
  </code></pre>
  
  <p>I want to use one route where I can pass the <code>mode</code> as param and get the right <code>templateUrl</code>:</p>
  
  <pre><code>angular
    .module('abcApp', ['ui.router'])
    .config(function ($stateProvider, $urlRouterProvider) {
      $stateProvider
        .state('userMangement', {
          url: '/mgt/user/:mode/:userId',
          templateUrl: 'views/mgt_user/' + $routeParams.mode + '.html',
          controller: 'MgtUserCtrl'
        });
    });
  </code></pre>
  
  <p><code>mode</code> can be : <code>view</code>, <code>edit</code>, <code>list</code>.</p>
  
  <p>Is there a way to do this?</p>