I am working my way through the AngularJS tutorial. Angular uses it\'s own JS routing mechanism to allow for single page apps. A sample routing file for Angular looks like t
For question #1 you could introduce a route like this:
/partials/:view controllers.Application.showView(view:String)
Then in your controller you would need to map from view name to actual view:
Map("phone_index" -> views.html.partials.phone_index())
You might want to render the templates lazy or require the request to be present, then you should probably do something like this:
val routes = Map(
"phone_index" -> { implicit r:RequestHeader =>
views.html.partials.phone_index())
}
Your action would look something like this:
def showView(view:String) =
Action { implicit r =>
routes(view)
}
If you want a specific controller method for a certain route (question #2) you simple add a route above the dynamic one:
/partials/specific controllers.Application.specific()