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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
This works:
@{ /* Comment */ }
But I was hoping something even better (requiring less typing) is out there.
回答3:
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 :(
回答4:
@* comment *@ works in play framework version 2