Reputation: 15593
When I write this code bellow in my login.scala.html, only the words 'foo' are showed, in other words, 'bar' is never showed.
<body>
@{
<span>bar</span>
if(true)
{
<span>foo</span>
}
}
@{
<span>bar</span>
for(i <- numbers)
{
<span>bar</span>
<span>i.toString()</span>
}
}
</body>
Someone knows why?
Upvotes: 0
Views: 49
Reputation: 919
As you used the block statement, it returning the last expression.
For example (try it in REPL):
val a: Int = 10
val b: Int = 20
{
a
b
}
Output:
res0: Int = 20
Upvotes: 1