I've defined function in Scala.js like this:
val myFunction: js.Function1[js.Array[String], Boolean] = (data: js.Array[String]) => true
And also defined Javascript function on the page:
function callFunction(inputFunction){
console.log(inputFunction(["10"]))
}
When I make a call from Scala.js:
GlobalScope.callFunction(myFunction)
I got error:
Uncaught TypeError: inputFunction is not a function
What I'm doing wrong and how to fix it?
Definition of the GlobalScope:
@JSGlobalScope
@js.native
object GlobalScope extends js.Any {
def GlobalScope.callFunction(someFunction: (js.Array[String]) => Boolean): Unit = js.native
}
GlobalScopeand its methodcallFunction?