Play 2.8 and @this
Hi.
I tried to inject
@import play.api.Play
@this(configuration: com.typesafe.config.Config)
@(error: Boolean)
<!DOCTYPE html>
into template to use it to obtain some information for footer. Problem is that compiled code results looks like
class login @javax.inject.Inject()@javax.inject.Inject() /*3.6*/(configuration: com.typesafe.config.Config) extends ...
@javax.inject.Inject()@javax.inject.Inject() is inserted twice - and I have no idea why. Could any one have idea what might cause it ?
@Finu I am pretty sure that is because you set
TwirlKeys.constructorAnnotations += "@javax.inject.Inject()"
in your build.sbt. Just remove that from your build.sbt.
You don't have to set this yourself when using Play. That's because Play sets it for you already. Only when using twirl without Play you have to set this yourself.
@Finu could you solve your problem?
@Finu closing for now. Feel free to re-open if you think you still ran into a bug.