Questions tagged [binding.scala]

Binding.scala is a data-binding framework for Scala, running on both JVM and Scala.js. Binding.scala can be used as a reactive web framework. It enables you use native XHTML literal syntax to create reactive DOM nodes, which are able to automatically change whenever the data source changes.

Binding.scala is a data-binding framework for Scala, running on both JVM and Scala.js.

Binding.scala can be used as a reactive web framework. It enables you use native XHTML literal syntax to create reactive DOM nodes, which are able to automatically change whenever the data source changes.

More information: https://github.com/ThoughtWorksInc/Binding.scala

52 questions
8
votes
2 answers

leaflet map does not appear correctly until resize

I am using Leaflet with scalajs-leaflet facade on Binding.scala, and the map initializes/appears incorrectly. In order to reproduce the issue, i have prepared a lihaoyi/workbench page similar to that in scalajs-leaflet. First, download the forked…
mcku
  • 1,351
  • 12
  • 23
8
votes
0 answers

Binding.scala vs Haoyi's Scala.Rx + ScalaTags

How does Binding.scala compare to the concept described here? Apart from the design descriptions one might compare their implementations of TodoMVC: Binding.scala Scala.Rx + ScalaTags Edit: By now I compared them to scalajs-react. I think react…
Tamriel
  • 1,337
  • 1
  • 9
  • 9
6
votes
1 answer

Binding.scala - how to get updating count from Vars

I have a Vars binding statement, like so val data: Vars[Contact] = Vars.empty[Contact] I'm trying to show the number of elements like so:
{data.all.bind.size}
But this produces a complication error type mismatch; [error] found :…
Roman
  • 1,880
  • 1
  • 13
  • 12
4
votes
1 answer

How to perform unit test for Binding.Scala?

I had written components using Binding.scala and they're working fine for me. Now I want to unit test them using ScalaTest. How to unit test them? I had taken reference from Binding.scala's unit tests. However it's not working for me as get and…
Mitesh
  • 477
  • 1
  • 6
  • 22
4
votes
1 answer

How to combine binding fragments without wrapping them in an XML literal

I'm trying to combine 2 binding fragments into one without recourse to an englobing XML literal. See the following code: @dom def a =

a

@dom def b =

b

@dom def block = { //
{a.bind} {b.bind} //…
Chris
  • 63
  • 4
4
votes
1 answer

Can scalatags be used together with binding.scala?

Binding.scala's examples contain Scala XML tags as a language to code DOM fragments. Can scalatags be used instead?
Andrew Gaydenko
  • 267
  • 2
  • 11
3
votes
2 answers

How to set tabindex attribute

When using Binding.scala, I can not write html that uses the tabindex attribute. Is this a bug in Binding.scala / scala.js?


Mattias
  • 33
  • 6
3
votes
1 answer

Binding.scala: Strategy to have a defined length of a Vars

This is related to binding-scala-strategy-to-avoid-too-many-dom-tree-updates In my project scala-adapters I display log entries that are sent over a websocket. I have no control on how many entries are sent. So if there are a lot of entries the…
pme
  • 14,156
  • 3
  • 52
  • 95
3
votes
1 answer

How to insert raw html strings in Binding.scala

Reposting this question from gitter. Suggestions were made to modify simply the innerHTML attribute but I thinkt this is quite unconvenient.
zy4
  • 31
  • 1
3
votes
2 answers

How do I declare embedded css with Binding.scala

I tried to declare some embedded css with Binding.scala import com.thoughtworks.binding._, Binding._ import org.scalajs.dom._ @dom def css = dom.render(document.head, css) However, I…
Yang Bo
  • 3,586
  • 3
  • 22
  • 35
3
votes
1 answer

When I use Binding.scala, I got the error `each instructions must be inside a SDE block`, how can I fix this?

When I use Binding.scala, I want to create some divs according to source data someCollection: val someCollection = Seq("foo", "bar") someCollection.map { item =>
{item.bind}
} However, I got a compiler error each instructions must be…
Yang Bo
  • 3,586
  • 3
  • 22
  • 35
2
votes
1 answer

Binding.scala: bind does not work in a simple example used in Github Pages

I want to use Binding.scala in my Github Pages. The Problem I have is that the value that I bind is not updated. Here the example: val radiusVar = Var(3.0) @dom private lazy val plotly: Binding[HTMLElement] = { val radiusVal =…
pme
  • 14,156
  • 3
  • 52
  • 95
2
votes
3 answers

Type mismatch with Binding.scala involving scala.xml.Elem

I'm failing to compile a simple example of Binding.scala, and being a newbie, I have no intuition how to fix it. Maybe the README is slightly outdated? The example at https://github.com/ThoughtWorksInc/Binding.scala-sample is even older and causes…
stholzm
  • 3,395
  • 19
  • 31
2
votes
2 answers

How to fix the red mark that appears when using binding.scala in intellij?

I am developing with scalajs and binding.scala. I'm using the IDE as an Intellij. However, when using dom macro in Intellij, the following red mark appears. this error appears when I use the attribute value of id in the input element as macro What…
terdong
  • 43
  • 5
2
votes
2 answers

Binding.scala route redirecting to login page

I would like add "guards" to certain urls. These urls should only be accessed when the user is logged in. If not logged in i want to redirect the user to the login page. After a successful login i want the user to be "redirected" to the original…
raphaëλ
  • 6,393
  • 2
  • 29
  • 35
1
2 3 4