Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use "config" #45

Closed
rabejens opened this issue May 5, 2015 · 6 comments
Closed

Cannot use "config" #45

rabejens opened this issue May 5, 2015 · 6 comments
Assignees
Labels
Milestone

Comments

@rabejens
Copy link

rabejens commented May 5, 2015

When doing something like

Angular.module("mymodule").config(($routeProvider: RouteProvider) => {
  ...
})

I get a compiler error: "not found: value js"

Am I missing an import?

@Miuler
Copy link

Miuler commented May 6, 2015

I have the same problem, my code:

object Main extends JSApp {
  @JSExport
  override def main(): Unit = {
    val module = angular.createModule("history", Seq("ngRoute"))
    module.controllerOf[SearchCtrl]("SearchCtrl")
    module.config( ($routeProvider:RouteProvider) =>
      $routeProvider
        .when("/frontend/search",
          Route(templateUrl = "search.html", controller = "SearchCtrl"))
    )

  }
}

Stack

[error] /home/miuler/proyectos/medical-frontend/src/main/scala/medical/Main.scala:18: not found: value js
[error]     module.config( ($routeProvider:RouteProvider) =>
[error]                                                   ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 13 s, completed May 5, 2015 9:05:22 PM
1. Waiting for source changes... (press enter to interrupt)

@jokade jokade added the bug label May 6, 2015
@jokade jokade self-assigned this May 6, 2015
@jokade
Copy link
Owner

jokade commented May 6, 2015

Which version of angulate do you use (0.1, 0.2-SNAPSHOT, or some branch)?

@Miuler
Copy link

Miuler commented May 7, 2015

hi, jokade, I am using:

scalaVersion := "2.11.6"
libraryDependencies += "biz.enef" %%% "scalajs-angulate" % "0.2-SNAPSHOT"

@jokade
Copy link
Owner

jokade commented May 7, 2015

Ok, I can reproduce this error and will fix it soon.

As a temporary workaround, just add

import scalajs.js

-- Johannes

@jokade jokade added this to the v0.2 milestone May 7, 2015
@Miuler
Copy link

Miuler commented May 8, 2015

Genial, it work now, thanks.

PD. how you came to that conclusion? debug compiler?

@jokade jokade closed this as completed in d7b77a0 May 11, 2015
@jokade
Copy link
Owner

jokade commented May 11, 2015

@Miuler there are some debug flags to enable logging of the code generated by angulate at compile time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants