I want to export an array of names to be accessible by jQuery UI for autocompletion.
I defined an array:
@(JSExport @field)
val possibleNames = Array("AB", "CD", "ED")
and tried to use it in JavaScript:
$("#NameInput").autocomplete(
{ source: example.NameTest().possibleNames }
);
However this give me an error:
TypeError: this.source is not a function
this.source( { term: value }, this._response() );
I tried to export a function like
@JSExport
def testFunction(): Array[String] = {
Array("AB", "CD", "ED")
}
But the result is the same.
Any ideas what to do?