I am using Play framework 2.5 and trying to inject a WSClient into the scala object used in my controllers.
import play.api.libs.concurrent.Execution.Implicits.defaultContext
object MyObject {
@Inject
var ws: WSClient = null
def doSomething() = {
}
I use MyObject in several controllers and when doSomething () is called, wsclient is null.
source
share