Skip to content

Instantly share code, notes, and snippets.

@andrewconner
Created February 11, 2013 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewconner/4757700 to your computer and use it in GitHub Desktop.
Save andrewconner/4757700 to your computer and use it in GitHub Desktop.
object Global extends GlobalSettings {
private lazy val injector = {
Play.isProd match {
case true => Guice.createInjector(new ProdModule)
case false => Guice.createInjector(new DevModule)
}
}
override def getControllerInstance[A](clazz: Class[A]) = {
injector.getInstance(clazz)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment