Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 09 04:00
    notyy commented #222
  • Oct 09 03:59
    notyy closed #222
  • Oct 09 03:59
    notyy commented #222
  • Oct 08 20:28
    Atry commented #223
  • Oct 08 20:28

    Atry on master

    docs: fix typo Merge pull request #223 from Ja… (compare)

  • Oct 08 20:28
    Atry closed #223
  • Oct 08 20:20
    Jason-Cooke opened #223
  • Oct 07 03:30
    glmars commented #222
  • Oct 06 04:05
    notyy opened #222
  • Oct 04 11:29
    datalchemist commented #217
  • Oct 04 11:02
    datalchemist commented #217
  • Oct 04 06:58

    Atry on scalafmt

    (compare)

  • Oct 04 06:46

    Atry on master

    Run scalafmt Merge branch 'master' into scal… Merge pull request #221 from Th… (compare)

  • Oct 04 06:46
    Atry closed #221
  • Oct 04 06:46
    Atry synchronize #221
  • Oct 04 06:46

    Atry on scalafmt

    Update scalafmt to 2.0.1 Update sbt to 1.3.2 Merge pull request #215 from sc… and 2 more (compare)

  • Oct 04 06:06
    Atry commented #217
  • Oct 04 05:30
    glmars commented #217
  • Oct 04 05:09
    Atry closed #191
  • Oct 04 05:09

    Atry on master

    Update scalafmt to 2.0.1 Merge pull request #203 from sc… (compare)

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..
Chris Camel
@ccamel
@ankitson Hello. Did you fix your issue ?
Kahli Burke
@kahliburke
@ankitson Here is an example of how to implement your tic tac toe. It's a little more awkward because you are storing a List[Var] instead of using Vars which is set up to hold a collection of dynamic data, but it works: https://scalafiddle.io/sf/ivFMrlo/3
杨博 (Yang Bo)
@Atry

We now have a StackOverflow badge on the README page, like this:

StackOverflow

Always ask you question about general usage on StackOverflow. Those Q&A are more searchable than GItter.

Andrzej Sołtysik
@asoltysik
@Atry I've seen a comment in the code about replacing @dom with @html, how will html differ and what's the motivation?
杨博 (Yang Bo)
@Atry
I thought @dom is not very intuitive, as it changes return types
@dom val i: Binding[Int] = 42
But it seems no one care about that.
So I decide to keep @dom as is, until someone creates a PR to change it.
Andrzej Sołtysik
@asoltysik
With @html one would have to make it explicit like Binding.pure(42)?
杨博 (Yang Bo)
@Atry
Binding(42) or Applicative[Binding].pure(42), not Binding.pure(42)
Ankit Soni
@ankitson
@ccamel @kahliburke Thanks! that does fix it, i will try to see why this works and my way doesnt.
Seung-Zin Nam
@zy4
is there a binding way to append a dom element to another?
without re-rendering the parent
杨博 (Yang Bo)
@Atry
@zy4 Have you seen the StackOverflow badge?
Kahli Burke
@kahliburke
I answered your question (as I understand it)
@zy4 ^
Seung-Zin Nam
@zy4
@kahliburke thanks but this does not solve my issue
I did it already that way