You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So as someone new to the framework I assumed that I could use value within a for comprehension in combination with the scalaz workaround i.e.
import com.thoughtworks.binding.Binding.{Var, Vars}
import com.thoughtworks.binding.dom
case class SelectOption(label: Var[String], value: Var[String])
val options = Vars.empty[SelectOption]
@dom def render(): Unit = {
import scalaz.std.list._
<select> {
for (option <- options.value) yield {
<option value={option.value.bind}>{option.label.bind}</option>
}
}
</select>
}
However this causes the option.value and option.label bindings to fail with the "each instructions must be inside a SDE block" error. Changing the for loop to the following fixes the issue:
for (option <- options)
This is extremely confusing and inconsistent since you can use the value attribute for adding, deleting and some iterating (?) but not within a for comprehension.
The text was updated successfully, but these errors were encountered:
If you look at the Todo example there is frequent use of the value attribute of a Vars for example:
So as someone new to the framework I assumed that I could use value within a for comprehension in combination with the scalaz workaround i.e.
However this causes the option.value and option.label bindings to fail with the "each instructions must be inside a SDE block" error. Changing the for loop to the following fixes the issue:
This is extremely confusing and inconsistent since you can use the value attribute for adding, deleting and some iterating (?) but not within a for comprehension.
The text was updated successfully, but these errors were encountered: