0

如果我有一些错误的代码,*scala.html在 Play 的模板文件中进行了注释,它会在编译期间给出错误。如何让 Play 明白这只是一条评论?

4

1 回答 1

1

Play 中的服务器端注释应该写成(我用过很多次,没有任何编译问题):

@* your comment here *@

但根据以下帖子(http://stackoverflow.com/questions/6398059/what-is-the-server-side-comment-tag-in-scala-templates-in-play-framework)这可能会产生编译错误在 Scala 模板中(用于 Play!1.x!)

也许,但我对此表示怀疑,以下内容可能对您有用:

@{ /* Comment */ }
于 2012-04-22T09:04:53.010 回答