I am porting the Scala Play application to 2.5 and am currently porting my components to dependency injection. There is one place left where I do not understand how to do this. I have an implicit PathBindable transformation defined in a companion object:
object Task { implicit def pathBindable(implicit stringBinder: PathBindable[String]) = new PathBindable[Task] { ... } }
The PathBindable implementation should look for the object from the repository, but I did not find a way for the dependencies to embed the repository here. As a workaround, I use the now obsolete Play object:
val tasks = Play.application(Play.current).injector.instanceOf[TasksRepository]
Any ideas how to solve this?
Mirko stocker
source share