package bindable
- Source
- package.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- bindable
- ToBindableSeqOps
- ToBindableOps
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- trait Bindable[-From] extends Serializable
A dependent type class that witnesses a type that can be converted to a
Binding[Value].A dependent type class that witnesses a type that can be converted to a
Binding[Value].- Annotations
- @implicitNotFound("Could not find an instance of Bindable for ${From}")
- trait BindableSeq[-From] extends Serializable
A dependent type class that witnesses a type that can be converted to a
BindingSeq[Value].A dependent type class that witnesses a type that can be converted to a
BindingSeq[Value].- Annotations
- @implicitNotFound("Could not find an instance of BindableSeq for ${From}")
This type class is internally used in the org.lrng.binding.html annotation, automatically converting any compatible values into com.thoughtworks.binding.Binding.BindingSeq, injecting into a HTML template.
import org.lrng.binding.html import org.scalajs.dom._ @html def myBinding = <span>Single Element</span> @html def myBindingSeq = <span>Element 1</span><span>Element 2</span> @html def myBindingOrBindingSeq(singleElement: Boolean) = { if (singleElement) { <span>Single Element</span> } else { <span>Element 1</span><span>Element 2</span> } } @html def mySection = <section> {myBinding.bind} {myBinding} {myBindingSeq} {Binding{myBindingSeq.all.bind.toSeq}} {myBindingSeq.all.bind.toSeq} {myBindingOrBindingSeq(true)} {myBindingOrBindingSeq(false)} </section> val root = document.createElement("span") html.render(root, mySection) root.innerHTML should be( """<section> <span>Single Element</span> <span>Single Element</span> <span>Element 1</span><span>Element 2</span> <span>Element 1</span><span>Element 2</span> <span>Element 1</span><span>Element 2</span> <span>Single Element</span> <span>Element 1</span><span>Element 2</span> </section>""" )
Example:
Value Members
- implicit def bindableToBinding[From, Value](from: From)(implicit bindable: Lt[From, Value]): Binding[Value]
- implicit def toBindableOps[From](target: From)(implicit tc: Bindable[From]): Ops[From] { type TypeClassType = com.thoughtworks.binding.bindable.Bindable[From]{type Value = tc.Value} }
- Definition Classes
- ToBindableOps
- Annotations
- @SuppressWarnings()
- implicit def toBindableSeqOps[From](target: From)(implicit tc: BindableSeq[From]): Ops[From] { type TypeClassType = com.thoughtworks.binding.bindable.BindableSeq[From]{type Value = tc.Value} }
- Definition Classes
- ToBindableSeqOps
- Annotations
- @SuppressWarnings()
- object Bindable extends LowPriorityBindable0 with Serializable
- object BindableSeq extends LowPriorityJsBindableSeq0 with Serializable