scalajs + uirouter how use it in the right way

226 views Asked by At

I'm try to start with scala.js and Angular. For that I'm using greencatsoft/scalajs-angular (https://github.com/greencatsoft/scalajs-angular) port

I found also a good sample https://github.com/josdirksen/smartjava/tree/master/scalajs

This sample is using "classic" routeProvider

routeProvider
   .when("/home", Route(HomeController))

but I would use the StateProvider.

I included the dependecies:

jsDependencies += "org.webjars" % "angular-ui-router" % "0.2.14" / "angular-ui-router.js" dependsOn "angular.js"

an of cures also in my scala-module:

val module = Angular.module("helloworld",Seq("ui.router","mm.foundation")) 

Usage:

override def initialize() {
    stateProvider
      .state("home", State(
            url="/home"
          , templateUrl = "myTest.html"
        )
      )
  }

But there was no way to "activate" the state.

  1. I'missing in the State apply the possibility to add a Controller. Unclear for my why or how

  2. I added the controller in the html < div ng-controller="DataController">

any Idea?

0

There are 0 answers