Scala (Play 2.4.x) How to call a class with @inject() annotation
问题 I'm looking at the scaly code example from play-mailer: https://github.com/playframework/play-mailer It goes basically like this: class MyComponent @Inject() (mailerClient: MailerClient) { ... } simple enough and it compiles without compliant Then I try to "call" it however and there doesn't appear to be a way to satisfy the compiler OR get a working instance of mailerClient. object AnObject { val mailer = new MyComponent def sendEmail = mailer.doStuff } [info] Compiling 1 Scala source to ...