In plain JavaScript you can do:
angular.module('mymodule', ['ionic'])
.config(function($someParam1, $someParam2) {
// do something with the parameters
}
I am trying to do this with Scala.js. I tried the following three attempts, all of which failed:
Attempt 1: Use scalajs-angular
Angular.module("mymodule", Seq("ionic")).config(MyConf)
Problem: MyConf
must extend Config
and I did not find any location where I could pass in parameters.
Attempt 2: Use scalajs-angulate
Angular.module("mymodule", Seq("ionic")).config((a: Any, b: Any) => {...})
This should work, but I get a compiler error: not found: value js
Attempt 3: Use the dynamically typed API
global.angular.module("mymodule", Seq("ionic")).config((a: Any, b: Any) => {...})
Compiles, but the content inside the {} does not get called.
The only way I can think of now is writing a javascript based "Bridge" which does something like:
angular.module('mymodule', ['ionic']).config(function($a, $b) {
com.example.myapp.MymoduleConfigurator.config($a, $b);
}
where com.example.myapp.MymoduleConfigurator
is written in Scala.
Is this the only way or is there a better approach?