scala - ScalaJS enumeration -


i trying use enums angularjs-toaster

class toaster extends js.object{   // see https://github.com/jirikavi/angularjs-    toaster/blob/master/toaster.js#l58   def pop(`type` : toastertype,title : string,body:string) : unit = js.native } 

with enum this

object toastertype extends enumeration{   type toastertype = value   val success = value("success")   ... 

}

and calling like

toaster.pop(toastertype.success, "some title", "text") 

when toaster popped there no title or text. when use string type on pop definition , pass `"success" works expected.

(i used http://www.scala-js.org/doc/semantics.html , https://github.com/scala-js/scala-js/issues/38. thought above should work, no?)

scala enumerations not strings, should not work. have use string, thing javascript string.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -