Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme example not working #2

Open
ankusharya opened this issue Feb 22, 2020 · 0 comments
Open

Readme example not working #2

ankusharya opened this issue Feb 22, 2020 · 0 comments

Comments

@ankusharya
Copy link

I am facing issue in making first example of Readme.md work.

import akka.ui._
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Sink, Source}
import org.scalajs.dom.raw.Event
import scalatags.JsDom.all._
import org.scalajs.dom.document

object Ankush {

def main(args: Array[String]): Unit = {
implicit val system = ActorSystem("AkkaUI")
implicit val materializer = ActorMaterializer()

val textBox =  input(placeholder := "Name").render
val name = span().render

val source: Source[Event, NotUsed] = textBox.source("input") // <---- Type Error Any does not confirm to type of Source
val sink: Sink[String, NotUsed] = name.sink("textContent") // <---- Type Error Any does not confirm to type of Sink


source.map(_ => textBox.value).runWith(sink)

val root = div(
  textBox,
  h2("Hello ", name)
)

document.querySelector("#root").appendChild(root.render)

}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant