I try to compile a scala example in the book: \"Play for Scala\" but get a following compilation error on Play console:
C:\\Play\\exp\\ch6_implicits>activ
Play 2.4, by default, generates a dependency injected router, unlike previously, when it used a static router. You have two options, remove the routesGenerator line from build.sbt so play will generate a static router, or (better) make your controllers classes instead of objects, and use dependency injection.
Include below code into into your conf/application.conf file:
play.allowGlobalApplication = true
remove routesGenerator := InjectedRoutesGenerator from yout file build.sbt and all will work
Change your object to a class like this:
object Shop extends Controller with WithCart {
class Shop extends Controller with WithCart {
object Application extends Controller with WithCart {
class Application extends Controller with WithCart {