Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 03 04:02
    scala-steward closed #286
  • Nov 03 04:02
    scala-steward opened #297
  • Oct 17 02:41
    scala-steward opened #296
  • Oct 06 19:15
    scala-steward opened #295
  • Oct 04 09:58
    romansky commented #294
  • Oct 04 09:02
    Atry closed #294
  • Oct 04 09:02
    Atry commented #294
  • Oct 01 15:27

    Atry on master

    Update the link (compare)

  • Oct 01 15:17
    romansky opened #294
  • Sep 29 23:57
    scala-steward opened #293
  • Sep 18 21:04
    scala-steward opened #292
  • Sep 14 19:28
    scala-steward opened #291
  • Sep 08 17:57
    scala-steward opened #290
  • Aug 31 04:42
    scala-steward opened #289
  • Aug 11 03:17
    scala-steward opened #288
  • Aug 07 06:53
    scala-steward opened #287
  • Jul 27 16:34
    scala-steward opened #286
  • Jul 20 19:58
    scala-steward opened #285
  • Jul 11 00:24
    scala-steward opened #284
  • Jun 30 21:04
    scala-steward opened #281
林煒清(Lin Wei-Ching)
@superChing
need help. thank you.
Yang, Bo
@Atry
StackOverflow seems like a better place to ask questions like this
Kahli Burke
@kahliburke
@superChing Remove Binding from v2, it's already annotated with
@dom
林煒清(Lin Wei-Ching)
@superChing
thanks
Mustafa Kuscu
@mcku
Hi, consider an ajax method that most of the time returns the same value. Whenever that result is bound to a dom component, during the ajax call it disappears and gets re-rendered with the same value. I would like to avoid this behavior by declaring that binding to be a constant, with no success. The ajax result is a future binding which does not map into a constant. Or am i missing something here?
is it possible to have a forced constant futurebinding output?
i hope i am missing something otherwise it will eventually become seeking cumbersome ways to do kind of like 'diffing' and batched rendering?
Yang, Bo
@Atry
@mcku The built-in FutureBinding implementation only has 79 lines of code. Feel free to copy and create your own variant of FutureBinding.
Mustafa Kuscu
@mcku
thanks, i will try that..
Naden
@nadenf
Anyway know why this doesn't work ? https://scalafiddle.io/sf/EHdex4U/2
Binh Nguyen
@ngbinh
alpaka 0.17 has been tagged and updated on the website but looks like no maven artifact yet https://mvnrepository.com/artifact/com.lightbend.akka/akka-stream-alpakka-s3_2.12 . Anyone know how low will it take?
Sandro Gržičić
@SandroGrzicic
hi guys, I am new to Binding.scala, but I like using it so far; I have created a simple scala.js app with two pages and am trying now to "link" the Binding router to the dom.render method. However everything I try gives me a compile time error.
the code is really basic so I will try to experiment further, but I really don't understand the compile error:

in my main method: dom.render(document.body, router.currentRoute)

in my router: @dom def currentRoute: Binding[_ <: Node] = router.state.bind.view.bind
where view is: view: Binding[_ <: Node]

I also tried removing the .bind, removing the @dom, etc. - nothing works; if I replace the .bind with .value (and remove @dom) then it compiles but as expected, doesn't change the view when the hash changes (it only correctly loads the initial view when I reload the page)
Sandro Gržičić
@SandroGrzicic
and my error is usually something like:
[error]  found   : _$2(in method currentRoute) => _$2(in method currentRoute) where type _$2(in method currentRoute) <: org.scalajs.dom.raw.Node
[error]  required: _$2(in value $anonfun) => _$2(in method currentRoute) where type _$2(in method currentRoute) <: org.scalajs.dom.raw.Node, type _$2(in value $anonfun) <: org.scalajs.dom.raw.Node
I'll continue trying but I would appreciate any help; it seems like such a simple thing to do and I am failing at it.
I'm using scala.js 0.6.22 and Binding.scala 11.0.1 (dom, futurebinding, route)
Sandro Gržičić
@SandroGrzicic
Interesting. The exact some code now works. I first put in some HTML inside the method, and put the router.state.bind.view.bind inside some curly braces, and that worked, then I reverted all the changes and now that works too. Weird
[edit] Just ran the code and it works beautifully. When I change the URL hash (#) by clicking on a nav link, the view re-renders. Awesome.
Seung-Zin Nam
@zy4
Hi, is there a way to render raw unsanitized html like using raw() from scalatags?
Kahli Burke
@kahliburke
@zy4 You can use the innerHTML attribute on a containing tag
Seung-Zin Nam
@zy4
@kahliburke that's what I did in the end but I don't like this as a solution because I need to wait for the dom element to be rendered
so I had to wait via setTimeout for this to happen :(
So I actually would like to insert raw strings before rendering happens
Seung-Zin Nam
@zy4
@glmars the only way I could use this would be to have nested rendering. Who else would find it useful to have a native way of just embedding raw html as strings?
Yang, Bo
@Atry
This gitter channel is really not a good place to ask or answer questions like this. Those disscussion are not searchable, and will not help other people who face the same issue.
Yang, Bo
@Atry
@zy4 The exact same question was asked in this Gitter channel two years ago, apparently you were not able to find it, because it was not indexed by Google or indexed at a low PageRank, unfortunately.
prassee
@prassee
I have seen Binding.scala examples in ScalaFiddle are all written in Chinese is there a English version available
Seung-Zin Nam
@zy4
@Atry I will repost this on github
Yang, Bo
@Atry
Or StackOverflow
Leonid Turnaev
@glmars
@Atry do you have any news about @html support?
prassee
@prassee
is there any example which uses routes...
Leonid Turnaev
@glmars
Pascal Mengelt
@pme123
@prassee I wrote a small framework that also uses Routing, check https://pme123.github.io/scala-adapters/. This is work in progress - but there is also a Giter.8 template to get you started.
Yang, Bo
@Atry
Look very nice!
Pascal Mengelt
@pme123
@Atry thanks, still a big fan of this framework! Great Job!
Yang, Bo
@Atry
:smile:
snakelenas
@snakelenas
极其优秀的一个框架,thanks !
Andrzej Sołtysik
@asoltysik
Hi, what's the maintainers' approach to documentation? I would like to contribute some routing docs/tutorial when I have time. Where should I put it?
My guess would be the wiki, I see some non-english page there (a tutorial I guess) - is it ok if I contribute a new page there?
Yang, Bo
@Atry
@asoltysik Feel free to create new wiki pages for motive examples.
Aslo you can edit the ScalaDoc for basic concept and simple independent examples.
Ankit Soni
@ankitson

hi guys, im trying a very simple example and i dont understand why it doesnt work -

  val squareValues:List[Var[Any]] = List(
    Var(0),Var(1),Var(2)
  )

  @tdom
  def square(id: Int): Binding[Node] = {
    def clickHandler() = { (_:MouseEvent) =>
      println(f"click $id");
      squareValues(id).value="X"
    }

    <button class="square" onclick={clickHandler}>{squareValues(id).value.toString}</button>
}
   ….
    tdom.render(appRoot, square(0))

now clicking the square doesnt change whats displayed.

nvm i got it working… i mixed up bind and value
Andrzej Sołtysik
@asoltysik
You shouldn't use value inside the dom method
replace this: {squareValues(id).value.toString} with this: {squareValues(id).bind.toString}
Andrzej Sołtysik
@asoltysik
@ankitson bind is the method that does actual binding to a var and registers your square method to change when the var changes
Ankit Soni
@ankitson
@asoltysik yep, i got it working.. thanks!
im still having trouble getting this working if anyone can take a look - https://scalafiddle.io/sf/RcuzfDO/3. its asimple tic tac toe game, from the React tutorial. the status is a binding, but it does not update when squares change
but i did bind not value..