codingwell / scala-guice

Scala extensions for Google Guice
Apache License 2.0
341 stars 44 forks source link

getInstance() with constructor parametrs #73

Closed Koyirov closed 5 years ago

Koyirov commented 6 years ago

Hello, I'm using guise version 4.1.0 in my project, but I'm not right with getInstance () function. injector.getInstance (classOf [startgame]), where startgame has to take a parameter. But if I do parameter purely, I take a error "starting game does not take a parameter." Can someone explain that to me? Thanks in advance.

tsuckow commented 6 years ago

You may want to look at https://github.com/google/guice/wiki/FrequentlyAskedQuestions#how-do-i-pass-a-parameter-when-creating-an-object-via-guice

You may also try asking https://groups.google.com/forum/#!forum/google-guice Be sure to include details of your bindings and not just getInstance