【发布时间】:2017-02-04 17:20:29
【问题描述】:
如何创建没有值的属性。
我想创建这样的(可能是无效的)html。注意 ng-app 和 ng-jq - 没有值的属性。
<html ng-app ng-jq>
...
...
</html>
在 scalatags 中,您将从以下内容开始:
import scalatags.JsDom.all._
html(
//and here what?
)
【问题讨论】:
如何创建没有值的属性。
我想创建这样的(可能是无效的)html。注意 ng-app 和 ng-jq - 没有值的属性。
<html ng-app ng-jq>
...
...
</html>
在 scalatags 中,您将从以下内容开始:
import scalatags.JsDom.all._
html(
//and here what?
)
【问题讨论】:
import scalatags.JsDom.all._
val `ng-app` = "ng-app".attr := "" //empty string does the job
val `ng-jq` = "ng-jq".attr := ""
html(`ng-app`, `ng-jq`)
更新
在 scalatags-0.6.0 中,这变得更加明确:
import scalatags.JsDom.all._
val `ng-app` = attr("ng-app") := "" //empty string does the job
val `ng-jq` = attr("ng-jq") := ""
html(`ng-app`, `ng-jq`)
【讨论】: