Hi I am pretty new in play framework and scala, continue I am reading the play documentation but I am facing problem while printing the index inside the map in the scala template file. I have tried below code but it was not working for me.
//Attempt 1: But not working
@(customer: Customer, orders: Seq[Order])
<h1>Welcome @customer.name!</h1>
<ul>
@orders.map { case(index,order) =>
<li>@index</li>
<li>@order.title</li>
}
</ul>
//Attempt 2: But not working
@(customer: Customer, orders: Seq[Order])
<h1>Welcome @customer.name!</h1>
<ul>
@orders.map { order =>
<li>@order.index</li>
<li>@order.title</li>
}
</ul>
Please give me some solution for this or give something other reference/resource link for play where I can explore more. You can find the above example from play documentation.