Skip to content

Known Problems

jokade edited this page Jun 13, 2015 · 3 revisions

Known Problems & Limitations

Controller

Controller Definition and Registration in Separate Files

Problem: When a body scope Controller is defined in a separate file than the corresponding module.controllerOf[] call, newly added defs and vals might be unavaliable in the template scope(see #52).

Reason: body scope Controllers rely on a macro to generate the necessary code to make all public members defined in the controller available to the template. This macro is executed where the corresponding module.controllerOf[] call is located, and it is only executed during compilation if the file that contains this call has changed (due to the incremental Scala compiler). Hence, if only the file with the controller definition changes, the required code generation does not occur and newly added memebers are not available in the template.

However, this does not affect changes to the bodies of defs and vals._

Workaround: Either keep Controller definitions and the corresponding controller[] calls in the same file, or force re-compilation via sbt clean whenever you add or remove a public member to/from a Controller.

affected Versions: all

Component

bind

Problem: When specifying the attribute bindings in a @Component annotation, there seems to be a problem when the ->notation is used for the js.Dictionary:

@Component(ComponentDef(
  selector = "foo",
  bind = js.Dictionary(
    "bar" -> "="  // may result in compile time error
  )))
class Foo

Workaround: Use tuple notation for the bind dictionary, i.e.

@Component(ComponentDef(
  selector = "foo",
  bind = js.Dictionary(
    ("bar","=")
  )))
class Foo

affected Versions: 0.2+

ngRoute / ui-router

Controller

As of version 0.2, body scope Controllers cannot be used in state definitions for ngRoute or ui-router (see #60). Please use ScopeControllers for routes instead.

SOLVED (affected Versions: 0.2.0)