1

Is it possible to do something like that

app.config(function($routeProvider){
  $routeProvider.when('/:controller/:action',
     {
        templateUrl:$routeParams.controller +'-'+ $routeParams.action + '.html'
        controller: $routeParams.controller+'Ctrl'
     }
  )
})

and then if the path is /Home/index it would grab Home-index.html and use HomeCtrl,

but for /Kill/mockingbird it would use Kill-mockingbird.html and KillCtrl

4

0 回答 0