0
私は次のモデルがあります:Binding.scalaでのパターンマッチングの使い方
case class CarBinding(ownerId: Var[String], specs: Var[Option[Specs]])
Specs
が特色であり、次の具体的な種類があります。私のScala.jsアプリで
trait Specs {
def name: String
}
case class SportsCarSpecs(name: String, details: Details) extends Specs
を、私は今、すべてのテーブルやリストを作成したいですエントリ:
:@dom
def buildTable(): Binding[BindingSeq[Node]] = {
val data = Vars.empty[CarBinding]
/* Initial population. */
// Some code...
<br/>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th class="col-md-1">
<small>Owner ID</small>
</th>
<th class="col-md-1">
<small>Specs</small>
</th>
</tr>
</thead>
<tbody>
{for (entry <- data) yield {
<tr>
<td>
<small>
{entry.ownerId.bind}
</small>
</td>
<td>
<small>
{entry.specs.bind match {
case Some(SportsCarSpecs(name, details)) => {name} <span>{details.ps}</span>
case _ => -
}}
</small>
</td>
</tr>
}}
</tbody>
</table>
</div>
}
はしかし、私は次のエラーを取得します
';' expected but $XMLSTART$< found.
[error] case Some(SportsCarSpecs(name, details)) => {name} <span>{details.ps}</span>
私は間違っていますか?