Nishikant
Nishikant

Reputation: 315

Compilation error with play 2 framework

I am trying to learn play framework, while practicing sample code I am getting an error: "illegal start of simple expression"

     @main("TODO list")
4{
5   <h1>@tasks.size() task(s)</h1>
6   <ul>
7       @for(task <- tasks) 

Error is shown in line 7, I have no idea why it is

Upvotes: 2

Views: 1483

Answers (1)

ndeverge
ndeverge

Reputation: 21564

You forgot the '{' character at the following line:

@for(task <- tasks){

It is needed on the same line by the Scala template engine to ensure that the '{' comes from the templating language, and that it is not a HTML character.

Upvotes: 4

Related Questions