traitScaldiSupport extends GlobalSettings with Injectable
Adds Scaldi support to the Global.
If you mix-in ScaldiSupport in the Global, then you need to implement applicationModule method:
override def applicationModule = new MyAppModule :: new AnotherModule
Implicit Injector would be available in scope so you can use it in different play callbacks like onStart
and onStop (ScaldiSupport also extends Injectable, so you can use inject without any additional setup):
override def onStart(app: Application) = {
super.onStart(app)
val service = inject [Service]
...
}
ScaldiSupport provides following pre-defined bindings:
playApp - Current play application
playMode - Current play application's mode (Dev, Prod or Test)
config - Current play application's configuration (all properties of configuration are also available as bindings)
Adds Scaldi support to the
Global
.If you mix-in
ScaldiSupport
in theGlobal
, then you need to implementapplicationModule
method:Implicit
Injector
would be available in scope so you can use it in different play callbacks likeonStart
andonStop
(ScaldiSupport
also extendsInjectable
, so you can useinject
without any additional setup):ScaldiSupport
provides following pre-defined bindings:Dev
,Prod
orTest
)