What is the server side comment tag in scala templ

2019-06-15 02:02发布

I need to comment my code server side ( not rendered to client) in scala templates in play framework. What is the format of this tag?

4条回答
贼婆χ
2楼-- · 2019-06-15 02:07

These two are working for scala-0.9.1 (on play framework):

@{ /* comment */ }

@{ // comment
}

But these not:

@{ // comment }
@* comment *@

Still, there's a lot of typing :(

查看更多
贼婆χ
3楼-- · 2019-06-15 02:09

The documentation does not explicitly say, but as the template engine is inspired by ASP.net Razor, I would guess it uses the same syntax, which is

@* comment here *@

Note the end comment is done with a closing @ symbol.

查看更多
Rolldiameter
4楼-- · 2019-06-15 02:13

This works:

@{ /* Comment */ }

But I was hoping something even better (requiring less typing) is out there.

查看更多
SAY GOODBYE
5楼-- · 2019-06-15 02:16

@* comment *@ works in play framework version 2

查看更多
登录 后发表回答